Skip to content

Commit

Permalink
fix (core): Add XMLToThingHandler test coverage for a bit more comple…
Browse files Browse the repository at this point in the history
…x (but not all) nested XML
  • Loading branch information
vorburger committed Sep 29, 2024
1 parent 96e5523 commit 4de0cb0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions java/dev/enola/format/xml/XMLToThingsHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ public void greeting1nested() throws IOException {
ThingsSubject.assertThat(thingsBuilder).isEqualTo("classpath:/greeting1.xml.ttl");
}

@Test
public void greeting1nesteds() throws IOException {
try (var ctx = TLC.open().push(XmlThingContext.NS, "https://example.org")) {
var from = URI.create("classpath:/greeting1-nesteds.xml");
assertThat(loader.convertInto(from, thingsBuilder)).isTrue();
}
ThingsSubject.assertThat(thingsBuilder).isEqualTo("classpath:/greeting1-nesteds.xml.ttl");
}

@Test
@Ignore // TODO FIXME
public void xhtml() throws IOException {
Expand Down
4 changes: 4 additions & 0 deletions test/greeting1-nesteds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<greeting1 lang="en">
<message> hello, world </message>
<from style="email">[email protected]</from>
</greeting1>
10 changes: 10 additions & 0 deletions test/greeting1-nesteds.xml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

<classpath:/greeting1-nesteds.xml>
<https://example.org/greeting1> [
<https://example.org/lang> "en";
<https://example.org/message> "hello, world";
<https://example.org/from> [
<https://example.org/style> "email";
<https://enola.dev/text> "[email protected]";
]
].

0 comments on commit 4de0cb0

Please sign in to comment.