Skip to content

Commit

Permalink
Ensure that deletion of a non-existent key does not produce an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff committed Aug 15, 2020
1 parent 6735c75 commit 4836fe9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/basic_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,18 @@ func SubtestNotFounds(t *testing.T, ds dstore.Datastore) {
switch err {
case dstore.ErrNotFound:
case nil:
t.Fatal("expected error getting size after delete")
t.Fatal("expected error getting size of not found key")
default:
t.Fatal("wrong error getting size after delete: ", err)
t.Fatal("wrong error getting size of not found key", err)
}
if size != -1 {
t.Fatal("expected missing size to be -1")
}

err = ds.Delete(badk)
if err != nil {
t.Fatal("error calling delete on not found key: ", err)
}
}

func SubtestLimit(t *testing.T, ds dstore.Datastore) {
Expand Down

0 comments on commit 4836fe9

Please sign in to comment.