aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-11 21:41:02 +0200
committerKim Alvefur <zash@zash.se>2020-05-11 21:41:02 +0200
commit0cf5e523843ae039f2aa005995cd320d7fe2ff1f (patch)
tree2bb49ffdc316cabfa34ef945e0cd64cc3a11f02d
parent1d34aa9296c22ac0e4dbcb2f352d38130d6a78f4 (diff)
downloadprosody-0cf5e523843ae039f2aa005995cd320d7fe2ff1f.tar.gz
prosody-0cf5e523843ae039f2aa005995cd320d7fe2ff1f.zip
spec/storage: Reset build context of test stanza make comparisons easier
While building a stanza there's a .last_add field keeping track of where in the XML tree tags are being added. This field does not survive a roundtrip through preserialize / deserialize. :reset() removes this, which simplifes comparisons after such a roundtrip.
-rw-r--r--spec/core_storagemanager_spec.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index b228c5fd..29ab014f 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -206,7 +206,8 @@ describe("storagemanager", function ()
local test_stanza = st.stanza("test", { xmlns = "urn:example:foo" })
:tag("foo"):up()
- :tag("foo"):up();
+ :tag("foo"):up()
+ :reset();
local test_time = 1539204123;
local test_data = {