aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-12-29 11:14:41 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-12-29 11:14:41 +0000
commit29b3e285a70b9117619fef7ebfad94c2e44e2a1c (patch)
tree897c53c006cb5ac6bd3da7af28f6e9c5836475f1 /python/tests
parente18fc185fa2604ba73f2b259e34796c106ad5545 (diff)
downloadandroid_external_libxml2-29b3e285a70b9117619fef7ebfad94c2e44e2a1c.tar.gz
android_external_libxml2-29b3e285a70b9117619fef7ebfad94c2e44e2a1c.tar.bz2
android_external_libxml2-29b3e285a70b9117619fef7ebfad94c2e44e2a1c.zip
fixed a bug pointed out by Stéphane Bidoul and integrated it into the
* xmlreader.c python/tests/reader.py: fixed a bug pointed out by Stéphane Bidoul and integrated it into the tests Daniel
Diffstat (limited to 'python/tests')
-rwxr-xr-xpython/tests/reader.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/python/tests/reader.py b/python/tests/reader.py
index 7b7dcc85..c615c700 100755
--- a/python/tests/reader.py
+++ b/python/tests/reader.py
@@ -235,6 +235,36 @@ if reader.MoveToNextAttribute() != 0:
print "Failed to detect last attribute"
sys.exit(1)
+#
+# Another test provided by Stéphane Bidoul and checked with C#
+#
+expect="""1 (a) [None]
+1 (b) [None]
+-- 2 (b1) [b1]
+1 (c) [None]
+3 (#text) [content of c]
+15 (c) [None]
+15 (a) [None]
+"""
+res=""
+f = StringIO.StringIO("""<a><b b1="b1"/><c>content of c</c></a>""")
+input = libxml2.inputBuffer(f)
+reader = input.newTextReader("test5")
+
+while reader.Read():
+ res=res + "%s (%s) [%s]\n" % (reader.NodeType(),reader.Name(),
+ reader.Value())
+ if reader.NodeType() == 1: # Element
+ while reader.MoveToNextAttribute():
+ res = res + "-- %s (%s) [%s]\n" % (reader.NodeType(),
+ reader.Name(),reader.Value())
+
+if res != expect:
+ print "test5 failed"
+ print res
+ sys.exit(1)
+
+
del f
del input
del reader