aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-19 21:56:33 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-19 21:56:33 +0100
commit3b0271f56013234cf4d967808627cd350f624f38 (patch)
tree39c97fae457df6b0b0fc7be6d30e6cd39b8114e6 /spec
parentc17a7856044ebd780de1cc5272210a6a77150dda (diff)
downloadprosody-3b0271f56013234cf4d967808627cd350f624f38.tar.gz
prosody-3b0271f56013234cf4d967808627cd350f624f38.zip
util.stanza + tests: Bail out of loop if we are iterating too far, fixes #981
Diffstat (limited to 'spec')
-rw-r--r--spec/util_stanza_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/util_stanza_spec.lua b/spec/util_stanza_spec.lua
index aabeeadc..383beae3 100644
--- a/spec/util_stanza_spec.lua
+++ b/spec/util_stanza_spec.lua
@@ -327,5 +327,12 @@ describe("util.stanza", function()
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);