Skip to content

Commit

Permalink
Merge pull request #162 from ncabatoff/assert-delete-missing-key-not-…
Browse files Browse the repository at this point in the history
…error

Add test to ensure that Delete returns no error for missing keys
  • Loading branch information
Stebalien authored Aug 17, 2020
2 parents 6735c75 + 4836fe9 commit 123d227
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 123d227

Please sign in to comment.