Test SPECDB::FIFO for the right eviction of cached data.
This commit is contained in:
parent
acd71238df
commit
54676448b8
@ -22,7 +22,7 @@ describe "SPECDB::FIFO" do
|
||||
car2 = Car.new "Corvet-2", "red", [] of String
|
||||
car3 = Car.new "Corvet-3", "red", [] of String
|
||||
|
||||
db = SPECDB::FIFO(Car).new("", 3)
|
||||
db = SPECDB::FIFO(Car).new "", 3
|
||||
|
||||
db.data.keys.sort.should eq([] of Int32)
|
||||
|
||||
@ -34,8 +34,9 @@ describe "SPECDB::FIFO" do
|
||||
|
||||
db << car2
|
||||
db.data.keys.sort.should eq([0, 1, 2] of Int32)
|
||||
db[0] # Let's use the first value, it shouldn't be the one to be dropped.
|
||||
|
||||
db << car3
|
||||
db.data.keys.sort.should eq([1, 2, 3] of Int32)
|
||||
db.data.keys.sort.should eq([0, 2, 3] of Int32)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user