saxophonit: Add a test for mixed content.
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Mon, 24 Nov 2014 14:39:55 +0000 (09:39 -0500)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Mon, 24 Nov 2014 14:49:56 +0000 (09:49 -0500)
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

lib/saxophonit/test_saxophonit.nit

index b1b1efc..270ed22 100644 (file)
@@ -193,4 +193,22 @@ class TestSaxophonit
                expected.end_document
                assert_equals
        end
+
+       fun test_mixed do
+               var atts = new AttributesImpl
+
+               # TODO For the moment, ignorable white space is not detected.
+               before_test
+               parse_string("<foo>  \r\n\n<bar>  baz  </bar></foo>")
+               expected.document_locator = new SAXLocatorImpl
+               expected.start_document
+               expected.start_element("", "foo", "foo", atts)
+               expected.characters("  \n\n")
+               expected.start_element("", "bar", "bar", atts)
+               expected.characters("  baz  ")
+               expected.end_element("", "bar", "bar")
+               expected.end_element("", "foo", "foo")
+               expected.end_document
+               assert_equals
+       end
 end