Implement packetcache.GetLast.

This commit is contained in:
Juliusz Chroboczek
2020-06-08 21:55:38 +02:00
parent da97560cb3
commit 0f96f94417
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -33,6 +33,10 @@ func TestCache(t *testing.T) {
if !bytes.Equal(buf[:l], buf1) {
t.Errorf("Couldn't get 13 at %v", i1)
}
l = cache.GetLast(buf)
if !bytes.Equal(buf[:l], buf2) {
t.Errorf("Couldn't get last")
}
l = cache.Get(17, buf)
if !bytes.Equal(buf[:l], buf2) {