Skip to content

Commit

Permalink
#3534 phi generation is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 24, 2024
1 parent 8eef8c1 commit d183103
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -86,6 +87,42 @@ void convertsSimpleObjectToPhi(@Mktmp final Path temp,
);
}

@Test
@Disabled
void convertsSimpleXmirToPhi(@Mktmp final Path temp) throws Exception {
new Farea(temp).together(
f -> {
f.clean();
f.files().file("target/eo/2-optimize/foo.xmir").write(
String.join(
" ",
"<program name='foo'><objects>",
"<o abstract='' name='foo'>",
"<o name='bar' base='xxx'>",
"<o base='org.eolang.bytes'>01 02 03</o>",
"</o></o></objects></program>"
).getBytes()
);
f.build()
.plugins()
.appendItself()
.execution()
.goals("xmir-to-phi");
f.exec("compile");
}
);
MatcherAssert.assertThat(
"the .phi file is generated",
new String(
Files.readAllBytes(
temp.resolve("target/eo/phi/foo.phi")
),
StandardCharsets.UTF_8
),
Matchers.containsString("α0 ↦ ⟦ Δ ⤍ 01-02-03 ⟧")
);
}

@Test
void convertsObjectWithSystemType(@Mktmp final Path temp) throws Exception {
new Farea(temp).together(
Expand Down

0 comments on commit d183103

Please sign in to comment.