diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-17 19:50:22 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-17 19:50:22 +0100 |
commit | 6c8d196c989a2963c9217da4ce365477e1b70cf6 (patch) | |
tree | fecce7dea7b0bd63cff950e024dda2c40625c0c9 | |
parent | f45bf9451883e0b988740ff160c2e2df5cd44db4 (diff) | |
download | prosody-6c8d196c989a2963c9217da4ce365477e1b70cf6.tar.gz prosody-6c8d196c989a2963c9217da4ce365477e1b70cf6.zip |
util.stanza: Test coverage of is_stanza()
-rw-r--r-- | spec/util_stanza_spec.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/util_stanza_spec.lua b/spec/util_stanza_spec.lua index ea3ef4c9..f7759385 100644 --- a/spec/util_stanza_spec.lua +++ b/spec/util_stanza_spec.lua @@ -198,4 +198,20 @@ describe("util.stanza", function() end); end); end); + + describe("#is_stanza", function () + -- is_stanza(any) -> boolean + it("identifies stanzas as stanzas", function () + assert.truthy(st.is_stanza(st.stanza("x"))); + end); + it("identifies strings as not stanzas", function () + assert.falsy(st.is_stanza("")); + end); + it("identifies numbers as not stanzas", function () + assert.falsy(st.is_stanza(1)); + end); + it("identifies tables as not stanzas", function () + assert.falsy(st.is_stanza({})); + end); + end); end); |