Skip to content

Commit 577dc6d

Browse files
committed
test: make more portable with newer libxml2
1 parent 6998d7b commit 577dc6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test-libxml2.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ function TestLibxml2XML.test_parse_invalid()
5151
local document = libxml2.xmlCtxtReadMemory(context, xml)
5252
luaunit.assertEquals(ffi.typeof(document),
5353
ffi.typeof("xmlDocPtr"))
54-
if tonumber(libxml2.VERSION) >= 20910 then
54+
-- This condition may be loose
55+
if tonumber(libxml2.VERSION) >= 20913 then
56+
luaunit.assertEquals(ffi.string(context.lastError.message),
57+
"Premature end of data in tag root line 1\n")
58+
elseif tonumber(libxml2.VERSION) >= 20910 then
5559
luaunit.assertEquals(ffi.string(context.lastError.message),
5660
"EndTag: '</' not found\n")
5761
else

0 commit comments

Comments
 (0)