Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-datastore
Commits
4836fe93
Commit
4836fe93
authored
Aug 15, 2020
by
Nick Cabatoff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that deletion of a non-existent key does not produce an error.
parent
6735c75a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
test/basic_tests.go
test/basic_tests.go
+7
-2
No files found.
test/basic_tests.go
View file @
4836fe93
...
...
@@ -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) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment