From 0cf5e523843ae039f2aa005995cd320d7fe2ff1f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 11 May 2020 21:41:02 +0200 Subject: 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. --- spec/core_storagemanager_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec') 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 = { -- cgit v1.2.3