From 0f0d32d335c2fb6bba59e5a6043412ad6d61e74a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 1 Feb 2021 12:47:05 +0100 Subject: mod_storage_sql: Implement map-like API for archives Used by mod_http_file_share, muc moderation, etc. Tests tweaked because they failed on stanza internals that happen becasue of re-serialization. Namespaces differ since inheritance is implicit when building but explicit after parsing. --- spec/core_storagemanager_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua index cf9429c1..7f86255f 100644 --- a/spec/core_storagemanager_spec.lua +++ b/spec/core_storagemanager_spec.lua @@ -556,7 +556,7 @@ describe("storagemanager", function () local id = archive:append("mapuser", nil, test_stanza, test_time, "contact@example.com"); do local stanza_roundtrip, when, with = archive:get("mapuser", id); - assert.same(test_stanza, stanza_roundtrip, "same stanza is returned"); + assert.same(tostring(test_stanza), tostring(stanza_roundtrip), "same stanza is returned"); assert.equal(test_time, when, "same 'when' is returned"); assert.equal("contact@example.com", with, "same 'with' is returned"); end @@ -568,7 +568,7 @@ describe("storagemanager", function () do local replaced, when, with = archive:get("mapuser", id); - assert.same(replacement_stanza, replaced, "replaced stanza is returned"); + assert.same(tostring(replacement_stanza), tostring(replaced), "replaced stanza is returned"); assert.equal(test_time+1, when, "modified 'when' is returned"); assert.equal("contact@example.com", with, "original 'with' is returned"); end -- cgit v1.2.3