# HG changeset patch # User Kim Alvefur # Date 1521312622 -3600 # Node ID e3e9479d526ed518a5b44772956040f144a819d7 # Parent 84b73949fc3000e459c60e4fd4eac55f01559479 util.stanza: Test coverage of is_stanza() diff -r 84b73949fc30 -r e3e9479d526e spec/util_stanza_spec.lua --- a/spec/util_stanza_spec.lua Sat Mar 17 19:47:48 2018 +0100 +++ b/spec/util_stanza_spec.lua Sat Mar 17 19:50:22 2018 +0100 @@ -198,4 +198,20 @@ 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);