More tests for FIFO.
This commit is contained in:
parent
9e1a633f97
commit
e608981fa9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user