tests/test.lua

changeset 3
d7524f665625
parent 0
24d141cb2d1e
child 4
a3cc83281bb8
equal deleted inserted replaced
2:95f4883da11f 3:d7524f665625
226 x = X[4] 226 x = X[4]
227 assert(x[1] == "e" and x[3] == "a/namespace?a") 227 assert(x[1] == "e" and x[3] == "a/namespace?a")
228 x = X[6] 228 x = X[6]
229 assert(x[1] == "en" and x[3] == "space" and table.getn(x) == 3) 229 assert(x[1] == "en" and x[3] == "space" and table.getn(x) == 3)
230 230
231 231 ----------------------------
232 print("testing doctype declarations")
233
234 callbacks = {
235 StartDoctypeDecl = getargs
236 }
237 p = lxp.new(callbacks)
238 assert(p:parse([[<!DOCTYPE root PUBLIC "foo" "hello-world">]]))
239 assert(p:parse[[<root/>]])
240 p:close()
241 assert(X[2] == "root" and X[3] == "hello-world" and X[4] == "foo" and
242 X[5] == false)
232 243
233 -- Error reporting 244 -- Error reporting
234 p = lxp.new{} 245 p = lxp.new{}
235 data = [[ 246 data = [[
236 <tag> 247 <tag>

mercurial