Comparison

spec/util_datamapper_spec.lua @ 11458:0e00fa518688

util.datamapper: Limited support for unparsing simple arrays of strings
author Kim Alvefur <zash@zash.se>
date Thu, 18 Mar 2021 13:07:10 +0100
parent 11457:6a51749af7f4
child 11462:d1982b7eb00d
comparison
equal deleted inserted replaced
11457:6a51749af7f4 11458:0e00fa518688
101 assert.equal(x:get_child_text("body"), u:get_child_text("body")); 101 assert.equal(x:get_child_text("body"), u:get_child_text("body"));
102 assert.equal(x:get_child_text("delay", "urn:xmpp:delay"), u:get_child_text("delay", "urn:xmpp:delay")); 102 assert.equal(x:get_child_text("delay", "urn:xmpp:delay"), u:get_child_text("delay", "urn:xmpp:delay"));
103 assert.same(x:get_child("delay", "urn:xmpp:delay").attr, u:get_child("delay", "urn:xmpp:delay").attr); 103 assert.same(x:get_child("delay", "urn:xmpp:delay").attr, u:get_child("delay", "urn:xmpp:delay").attr);
104 assert.same(x:get_child("origin-id", "urn:xmpp:sid:0").attr, u:get_child("origin-id", "urn:xmpp:sid:0").attr); 104 assert.same(x:get_child("origin-id", "urn:xmpp:sid:0").attr, u:get_child("origin-id", "urn:xmpp:sid:0").attr);
105 for _, tag in ipairs(x.tags) do 105 for _, tag in ipairs(x.tags) do
106 if tag.name ~= "UNRELATED" and tag.name ~= "reactions" then 106 if tag.name ~= "UNRELATED" then
107 assert.truthy(u:get_child(tag.name, tag.attr.xmlns) or u:get_child(tag.name), tag:top_tag()) 107 assert.truthy(u:get_child(tag.name, tag.attr.xmlns) or u:get_child(tag.name), tag:top_tag())
108 end 108 end
109 end 109 end
110 assert.equal(#x.tags-2, #u.tags) 110 assert.equal(#x.tags-1, #u.tags)
111
112 pending("arrays", function ()
113 assert.truthy(u:get_child("reactions", "urn:xmpp:reactions:0"))
114 end);
115 111
116 end); 112 end);
117 end); 113 end);
118 end) 114 end)