Add extra test case for deleting entire tree with empty prefix

This commit is contained in:
Preetha Appan 2017-07-26 09:42:07 -05:00
parent 4498814843
commit b94617b281
1 changed files with 14 additions and 0 deletions

View File

@ -1107,6 +1107,20 @@ func TestStateStore_Watches_PrefixDelete(t *testing.T) {
if got != wantIndex { if got != wantIndex {
t.Fatalf("bad index: %d, expected %d", got, wantIndex) t.Fatalf("bad index: %d, expected %d", got, wantIndex)
} }
// Delete all the keys, special case where tombstones are not inserted
if err := s.KVSDeleteTree(9, ""); err != nil {
t.Fatalf("unexpected err: %s", err)
}
wantIndex = 9
got, _, err = s.KVSList(nil, "/foo/bar")
if err != nil {
t.Fatalf("err: %s", err)
}
if got != wantIndex {
t.Fatalf("bad index: %d, expected %d", got, wantIndex)
}
} }
func TestStateStore_KVSLockDelay(t *testing.T) { func TestStateStore_KVSLockDelay(t *testing.T) {