summaryrefslogtreecommitdiff
path: root/spec/multiset_spec.lua
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-08-02 23:08:06 +0200
committerAki <please@ignore.pl>2024-08-02 23:08:06 +0200
commit71ae0ff1f713e45430ea02a1ff1e46ab2d28b63c (patch)
tree03eb631cfbd7ff812b152182db2e9ec6426e17a4 /spec/multiset_spec.lua
parent2f8c80182b43042b63a94b9226cb1966217d4a0f (diff)
downloadheaders-71ae0ff1f713e45430ea02a1ff1e46ab2d28b63c.zip
headers-71ae0ff1f713e45430ea02a1ff1e46ab2d28b63c.tar.gz
headers-71ae0ff1f713e45430ea02a1ff1e46ab2d28b63c.tar.bz2
Multiset ref counter will no longer go into negative numbers
Diffstat (limited to 'spec/multiset_spec.lua')
-rw-r--r--spec/multiset_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/multiset_spec.lua b/spec/multiset_spec.lua
index 7639066..abdeb94 100644
--- a/spec/multiset_spec.lua
+++ b/spec/multiset_spec.lua
@@ -95,6 +95,13 @@ describe("Values", function()
it("are not counted after removal", function()
assert.are.equal(1, #set)
end)
+
+ it("are removed only once", function()
+ set:remove"will-be-removed"
+ assert.is_false(set:has"will-be-removed")
+ set:add"will-be-removed"
+ assert.is_true(set:has"will-be-removed")
+ end)
end)