Software /
code /
prosody
Changeset
9467:2098794ac866
storagemanager tests: Add some additional checks
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 10 Oct 2018 22:03:11 +0100 |
parents | 9466:b70ce39d366f |
children | 9468:bd5e4485a245 |
files | spec/core_storagemanager_spec.lua |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/core_storagemanager_spec.lua Wed Oct 10 22:00:37 2018 +0100 +++ b/spec/core_storagemanager_spec.lua Wed Oct 10 22:03:11 2018 +0100 @@ -108,7 +108,9 @@ with = "contact@example.com"; }); assert.truthy(data); + local count = 0; for id, item, when in data do + count = count + 1; assert.truthy(id); assert(st.is_stanza(item)); assert.equal("test", item.name); @@ -116,10 +118,20 @@ assert.equal(2, #item.tags); assert.equal(test_time, when); end + assert.equal(1, count); end); it("can be purged", function () local ok, err = archive:delete("user"); assert.truthy(ok); + local data, err = archive:find("user", { + with = "contact@example.com"; + }); + assert.truthy(data); + local count = 0; + for id, item, when in data do -- luacheck: ignore id item when + count = count + 1; + end + assert.equal(0, count); end); end); end);