Changeset

10836:93019f3edd68

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.
author Kim Alvefur <zash@zash.se>
date Mon, 11 May 2020 21:41:02 +0200
parents 10835:e402f808de50
children 10837:f23363380599
files spec/core_storagemanager_spec.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/spec/core_storagemanager_spec.lua	Mon May 11 21:29:24 2020 +0200
+++ b/spec/core_storagemanager_spec.lua	Mon May 11 21:41:02 2020 +0200
@@ -206,7 +206,8 @@
 
 				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 = {