aboutsummaryrefslogtreecommitdiffstats
path: root/spec/core_storagemanager_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-02-01 12:17:56 +0100
committerKim Alvefur <zash@zash.se>2021-02-01 12:17:56 +0100
commitf307825a01fe5911ec373445c7b4f64e64da0785 (patch)
treefc738375c5456936376994ecf762b8fa7a265f82 /spec/core_storagemanager_spec.lua
parent72cecbe03c0bfe2c91bafc3d83a4aa2891fc05c1 (diff)
downloadprosody-f307825a01fe5911ec373445c7b4f64e64da0785.tar.gz
prosody-f307825a01fe5911ec373445c7b4f64e64da0785.zip
storage: Test reverse-ordered queries
Diffstat (limited to 'spec/core_storagemanager_spec.lua')
-rw-r--r--spec/core_storagemanager_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index 033559b4..cf9429c1 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -406,6 +406,28 @@ describe("storagemanager", function ()
end);
+ it("can be queried in reverse", function ()
+
+ local data, err = archive:find("user", {
+ reverse = true;
+ limit = 3;
+ });
+ assert.truthy(data, err);
+
+ local i = #test_data;
+ for id, item in data do
+ assert.truthy(id);
+ assert.equal(test_data[i][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);
+ i = i - 1;
+ end
+
+ end);
+
+
end);
it("can selectively delete items", function ()