Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,45 @@ void printsSyntaxWithComments() throws IOException {
Matchers.equalTo(expected)
);
}

/**
* Compiles XMIR bytes with an anonymous abstract object.
* @throws IOException If something goes wrong.
* @todo #3807:60m XMIR format for bytes with data should be fixed.
* Current representation of org.eolang.bytes with data in XMIR is wrong,
* we miss one anonymous abstract object.
* When we add the missing anonymous abstract object, we should remove
* the @Disabled annotation from this test.
*/
@Test
@Disabled
void compilesXmirBytesWithAnonymousAbstractObject() throws IOException {
Comment thread
volodya-lombrozo marked this conversation as resolved.
Outdated
final XML xmir = new EoSyntax(
"bytes-with-anonymous-abstract-object",
new InputOf(
String.join(
"\n",
"# No comments.",
"bytes > app",
" 00-00-00-00"
)
)
).parsed();
MatcherAssert.assertThat(
String.join(
"\n",
"XMIR should contain the anonymous abstract object for bytes. Expected: ",
"<o base='bytes' name='app'>",
Comment thread
volodya-lombrozo marked this conversation as resolved.
Outdated
" <o base='bytes'>",
" <o>00-00-00-00</o> <!-- Anonymous object -->",
" </o>",
"</o>",
String.format("Actual XMIR is:\n%s", xmir)
),
xmir,
XhtmlMatchers.hasXPath(
"/program/objects/o[@base='Q.org.eolang.bytes' and @name='app']/o[@base='Q.org.eolang.bytes']/o[text()='00-00-00-00']"
)
);
}
}
1 change: 1 addition & 0 deletions eo-parser/src/test/java/org/eolang/parser/XmirTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @since 0.5
*/
final class XmirTest {

@ParameterizedTest
@ClasspathSource(value = "org/eolang/parser/print-packs/yaml", glob = "**.yaml")
void printsToEo(final String pack) throws IOException {
Expand Down