--- a/spec/util_datamapper_spec.lua Sat Mar 20 21:25:45 2021 +0100
+++ b/spec/util_datamapper_spec.lua Sat Mar 20 21:29:51 2021 +0100
@@ -181,5 +181,16 @@
assert.equal(#x.tags-1, #u.tags)
end);
+
+ it("handles arrays", function ()
+ local u = map.unparse(disco_schema, disco);
+ assert.equal("urn:example:feature:1", u:find("{http://jabber.org/protocol/disco#info}query/feature/@var"))
+ local n = 0;
+ for child in u:get_child("query", "http://jabber.org/protocol/disco#info"):childtags("feature") do
+ n = n + 1;
+ assert.equal(string.format("urn:example:feature:%d", n), child.attr.var);
+ end
+ end);
+
end);
end)