equal
deleted
inserted
replaced
|
1 |
|
2 local xml = require "util.xml"; |
|
3 |
|
4 describe("util.xml", function() |
|
5 describe("#parse()", function() |
|
6 it("should work", function() |
|
7 local x = |
|
8 [[<x xmlns:a="b"> |
|
9 <y xmlns:a="c"> <!-- this overwrites 'a' --> |
|
10 <a:z/> |
|
11 </y> |
|
12 <a:z/> <!-- prefix 'a' is nil here, but should be 'b' --> |
|
13 </x> |
|
14 ]] |
|
15 local stanza = xml.parse(x); |
|
16 assert.are.equal(stanza.tags[2].attr.xmlns, "b"); |
|
17 assert.are.equal(stanza.tags[2].namespaces["a"], "b"); |
|
18 end); |
|
19 end); |
|
20 end); |