Mercurial > prosody-hg
diff 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 |
| parents | ba38a947020e |
| children | 57f8e41255fb |
line wrap: on
line diff
--- a/spec/util_stanza_spec.lua Sun Aug 19 21:29:52 2018 +0100 +++ b/spec/util_stanza_spec.lua Sun Aug 19 21:56:33 2018 +0100 @@ -327,5 +327,12 @@ end); assert.equal(3, #s.tags); end); + it("errors on invalid data - #981", function () + local s = st.message({}, "Hello"); + s.tags[1] = st.clone(s.tags[1]); + assert.has_error_match(function () + s:maptags(function () end); + end, "Invalid stanza"); + end); end); end);
