Comparison

spec/core_storagemanager_spec.lua @ 11273:9f1355689648

storage tests: Test querys with both before and after IDs Needed for extended MAM, supported by SQL storage already.
author Kim Alvefur <zash@zash.se>
date Tue, 12 Jan 2021 15:52:14 +0100
parent 10927:470602a8b633
child 11276:7b2ee8995af9
comparison
equal deleted inserted replaced
11272:44c9cb4094bb 11273:9f1355689648
359 assert.equal("urn:example:foo", item.attr.xmlns); 359 assert.equal("urn:example:foo", item.attr.xmlns);
360 assert.equal(2, #item.tags); 360 assert.equal(2, #item.tags);
361 end 361 end
362 assert.equal(3, count); 362 assert.equal(3, count);
363 end); 363 end);
364
365 it("by id (before and after) #full_id_range", function ()
366 assert.truthy(archive.caps and archive.caps.full_id_range, "full ID range support")
367 local data, err = archive:find("user", {
368 ["after"] = test_data[1][1];
369 ["before"] = test_data[4][1];
370 });
371 assert.truthy(data, err);
372 local count = 0;
373 for id, item in data do
374 count = count + 1;
375 assert.truthy(id);
376 assert.equal(test_data[1+count][1], id);
377 assert(st.is_stanza(item));
378 assert.equal("test", item.name);
379 assert.equal("urn:example:foo", item.attr.xmlns);
380 assert.equal(2, #item.tags);
381 end
382 assert.equal(2, count);
383 end);
384
364 end); 385 end);
365 386
366 it("can selectively delete items", function () 387 it("can selectively delete items", function ()
367 local delete_id; 388 local delete_id;
368 do 389 do