More tests for FIFO.

toying-with-ramdb
Philippe PITTOLI 2024-05-25 02:36:43 +02:00
parent 9e1a633f97
commit e608981fa9
1 changed files with 7 additions and 0 deletions

View File

@ -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