From e608981fa90838d87cc36fa9619449967500001e Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sat, 25 May 2024 02:36:43 +0200 Subject: [PATCH] More tests for FIFO. --- spec/test-fifo.cr | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/test-fifo.cr b/spec/test-fifo.cr index c326374..2639865 100644 --- a/spec/test-fifo.cr +++ b/spec/test-fifo.cr @@ -12,6 +12,9 @@ describe "FIFO" do (fifo << 2).should be_nil # -> nil (already in the stack) (fifo << 5).should eq 3 # -> 3 (least recently used data) fifo.data.should eq([5, 2, 4] of Int32) + + fifo.delete 2 + fifo.data.should eq([5, 4] of Int32) end end @@ -38,5 +41,9 @@ describe "SPECDB::FIFO" do db << car3 db.data.keys.sort.should eq([0, 2, 3] of Int32) + + db.delete 2 + db.data.keys.sort.should eq([0, 3] of Int32) + db.stack.data.should eq([3, 0] of Int32) end end