Software /
code /
prosody
Comparison
spec/core_storagemanager_spec.lua @ 12600:3d3a0c4e2662
Merge 0.12->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 29 Jul 2022 17:10:31 +0200 |
parent | 12589:39ae08180c81 |
parent | 12598:a2624315d30e |
child | 12956:52fcdfe710ca |
comparison
equal
deleted
inserted
replaced
12596:78f874441e21 | 12600:3d3a0c4e2662 |
---|---|
573 assert.equal(test_time+1, when, "modified 'when' is returned"); | 573 assert.equal(test_time+1, when, "modified 'when' is returned"); |
574 assert.equal("contact@example.com", with, "original 'with' is returned"); | 574 assert.equal("contact@example.com", with, "original 'with' is returned"); |
575 end | 575 end |
576 end); | 576 end); |
577 | 577 |
578 it("the summary api works", function() | |
579 assert.truthy(archive:delete("summary-user")); | |
580 local first_sid = archive:append("summary-user", nil, test_stanza, test_time, "contact@example.com"); | |
581 local second_sid = archive:append("summary-user", nil, test_stanza, test_time+1, "contact@example.com"); | |
582 assert.truthy(first_sid and second_sid, "preparations failed") | |
583 --- | |
584 | |
585 local user_summary, err = archive:summary("summary-user"); | |
586 assert.is_table(user_summary, err); | |
587 assert.same({ ["contact@example.com"] = 2 }, user_summary.counts, "summary.counts matches"); | |
588 assert.same({ ["contact@example.com"] = test_time }, user_summary.earliest, "summary.earliest matches"); | |
589 assert.same({ ["contact@example.com"] = test_time+1 }, user_summary.latest, "summary.latest matches"); | |
590 if user_summary.body then | |
591 assert.same({ ["contact@example.com"] = test_stanza:get_child_text("body") }, user_summary.body, "summary.body matches"); | |
592 end | |
593 end); | |
594 | |
578 end); | 595 end); |
579 end); | 596 end); |
580 end | 597 end |
581 end); | 598 end); |