Skip to content

Commit

Permalink
feat(objectionary#546): retrieves child test
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Nov 18, 2024
1 parent 5fd2d40 commit 299f320
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/java/org/eolang/jeo/representation/xmir/XmlNodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eolang.jeo.representation.bytecode.BytecodeLabel;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.hamcrest.core.IsEqual;
import org.junit.jupiter.api.Test;
import org.objectweb.asm.Opcodes;
import org.xembly.ImpossibleModificationException;
Expand Down Expand Up @@ -93,6 +94,23 @@ void retrievesText() {
);
}

@Test
void retrievesChild() {
final XmlNode child = new XmlNode(
"<program><o>text</o></program>"
).child("o");
final String expected = "<o>text</o>";
MatcherAssert.assertThat(
String.format(
"Retrieved XML: %s does not match with expected %s",
child,
expected
),
child,
new IsEqual<>(new XmlNode(expected))
);
}

@Test
void convertsToLabelEntry() throws ImpossibleModificationException {
MatcherAssert.assertThat(
Expand Down

0 comments on commit 299f320

Please sign in to comment.