From 71ae0ff1f713e45430ea02a1ff1e46ab2d28b63c Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 2 Aug 2024 23:08:06 +0200 Subject: Multiset ref counter will no longer go into negative numbers --- spec/multiset_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/multiset_spec.lua') 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) -- cgit v1.1