# HG changeset patch # User Kim Alvefur # Date 1610463134 -3600 # Node ID 9f1355689648805f2d495ff8929265d630d943fe # Parent 44c9cb4094bbaff83fcd4315ac3bba53f28244cd storage tests: Test querys with both before and after IDs Needed for extended MAM, supported by SQL storage already. diff -r 44c9cb4094bb -r 9f1355689648 spec/core_storagemanager_spec.lua --- a/spec/core_storagemanager_spec.lua Sat Jan 09 21:31:45 2021 +0100 +++ b/spec/core_storagemanager_spec.lua Tue Jan 12 15:52:14 2021 +0100 @@ -361,6 +361,27 @@ 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 ()