@Test
public void testFeaturesCommentsMixed2() throws IOException {
test("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!--comment--><root>aaa\naaa<child/>aaa\naaa</root>",
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--comment--><root>aaa\naaa<child/>aaa\naaa</root>",
(doc) -> {
Nodes.print(doc, LOGGER, Level.DEBUG);
assertEquals(2, doc.getChildrenCount());
assertEquals(1, doc.getChildrenCount(Comment.class));
assertEquals(3, doc.getRootElement().getChildrenCount());
assertEquals(2, doc.getRootElement().getChildrenCount(Text.class));
},
Feature.LOAD_COMMENTS,
Feature.LOAD_SPACES,
Feature.ALLOW_MIXED_CONTENT);
}
}