Add test for StartDoctypeDecl

Thu, 02 Jun 2011 16:21:30 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 02 Jun 2011 16:21:30 +0100
changeset 3
d7524f665625
parent 2
95f4883da11f
child 4
a3cc83281bb8

Add test for StartDoctypeDecl

tests/test.lua file | annotate | diff | comparison | revisions
--- a/tests/test.lua	Thu Jun 02 15:10:38 2011 +0100
+++ b/tests/test.lua	Thu Jun 02 16:21:30 2011 +0100
@@ -228,7 +228,18 @@
 x = X[6]
 assert(x[1] == "en" and x[3] == "space" and table.getn(x) == 3)
 
+----------------------------
+print("testing doctype declarations")
 
+callbacks = {
+  StartDoctypeDecl = getargs
+ }
+p = lxp.new(callbacks)
+assert(p:parse([[<!DOCTYPE root PUBLIC "foo" "hello-world">]]))
+assert(p:parse[[<root/>]])
+p:close()
+assert(X[2] == "root" and X[3] == "hello-world" and X[4] == "foo" and
+       X[5] == false)
 
 -- Error reporting
 p = lxp.new{}

mercurial