Comparison

spec/util_stanza_spec.lua @ 9217:7df29c5fbb9b

util.stanza + tests: Bail out of loop if we are iterating too far, fixes #981
author Matthew Wild <mwild1@gmail.com>
date Sun, 19 Aug 2018 21:56:33 +0100
parent 9216:ba38a947020e
child 9302:57f8e41255fb
comparison
equal deleted inserted replaced
9216:ba38a947020e 9217:7df29c5fbb9b
325 end 325 end
326 return tag; 326 return tag;
327 end); 327 end);
328 assert.equal(3, #s.tags); 328 assert.equal(3, #s.tags);
329 end); 329 end);
330 it("errors on invalid data - #981", function ()
331 local s = st.message({}, "Hello");
332 s.tags[1] = st.clone(s.tags[1]);
333 assert.has_error_match(function ()
334 s:maptags(function () end);
335 end, "Invalid stanza");
336 end);
330 end); 337 end);
331 end); 338 end);