Comparison

spec/core_storagemanager_spec.lua @ 11353:367e6beaf8ab

storage: Test reverse-ordered queries
author Kim Alvefur <zash@zash.se>
date Mon, 01 Feb 2021 12:17:56 +0100
parent 11276:7b2ee8995af9
child 11354:10fba62332c5
comparison
equal deleted inserted replaced
11352:e10567199f02 11353:367e6beaf8ab
404 assert.equal(2, count); 404 assert.equal(2, count);
405 405
406 end); 406 end);
407 407
408 408
409 it("can be queried in reverse", function ()
410
411 local data, err = archive:find("user", {
412 reverse = true;
413 limit = 3;
414 });
415 assert.truthy(data, err);
416
417 local i = #test_data;
418 for id, item in data do
419 assert.truthy(id);
420 assert.equal(test_data[i][1], id);
421 assert(st.is_stanza(item));
422 assert.equal("test", item.name);
423 assert.equal("urn:example:foo", item.attr.xmlns);
424 assert.equal(2, #item.tags);
425 i = i - 1;
426 end
427
428 end);
429
430
409 end); 431 end);
410 432
411 it("can selectively delete items", function () 433 it("can selectively delete items", function ()
412 local delete_id; 434 local delete_id;
413 do 435 do