update store clear test

This commit is contained in:
siddontang 2014-09-16 08:41:38 +08:00
parent 63f8f82727
commit 3a37b2e297
1 changed files with 20 additions and 0 deletions

View File

@ -134,4 +134,24 @@ func testLogs(t *testing.T, l Store) {
if err := l.GetLog(5, &out); err != ErrLogNotFound {
t.Fatalf("err: %v ", err)
}
if err := l.Clear(); err != nil {
t.Fatal(err)
}
idx, err = l.FirstID()
if err != nil {
t.Fatalf("err: %v ", err)
}
if idx != 0 {
t.Fatalf("bad idx: %d", idx)
}
idx, err = l.LastID()
if err != nil {
t.Fatalf("err: %v ", err)
}
if idx != 0 {
t.Fatalf("bad idx: %d", idx)
}
}