aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-12 15:52:14 +0100
committerKim Alvefur <zash@zash.se>2021-01-12 15:52:14 +0100
commitddd3fff2e97f76c56e9b0a61f23b2ff7b564d578 (patch)
tree1fcac95dd9c2938d66309351e20c403d3a9e146c
parentd0c7c6856218aad67ae5874ca4251dba7f30f08b (diff)
downloadprosody-ddd3fff2e97f76c56e9b0a61f23b2ff7b564d578.tar.gz
prosody-ddd3fff2e97f76c56e9b0a61f23b2ff7b564d578.zip
storage tests: Test querys with both before and after IDs
Needed for extended MAM, supported by SQL storage already.
-rw-r--r--spec/core_storagemanager_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index d07dc4ec..5ba1748c 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -361,6 +361,27 @@ describe("storagemanager", function ()
end
assert.equal(3, count);
end);
+
+ it("by id (before and after) #full_id_range", function ()
+ assert.truthy(archive.caps and archive.caps.full_id_range, "full ID range support")
+ local data, err = archive:find("user", {
+ ["after"] = test_data[1][1];
+ ["before"] = test_data[4][1];
+ });
+ assert.truthy(data, err);
+ local count = 0;
+ for id, item in data do
+ count = count + 1;
+ assert.truthy(id);
+ assert.equal(test_data[1+count][1], id);
+ assert(st.is_stanza(item));
+ assert.equal("test", item.name);
+ assert.equal("urn:example:foo", item.attr.xmlns);
+ assert.equal(2, #item.tags);
+ end
+ assert.equal(2, count);
+ end);
+
end);
it("can selectively delete items", function ()