Skip to content

Commit

Permalink
Increase testing coverage for invalid Iter bounds parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
umpc committed Jul 4, 2017
1 parent efa9a42 commit 4fa6095
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions iter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,13 @@ func TestBoundedIterFuncWithNoBoundsReturned(t *testing.T) {
if err != nil {
t.Fatal(err)
}

if err := sm.BoundedIterFunc(false, time.Now().Add(-1*time.Microsecond), time.Now(), func(rec Record) bool {
if err := sm.BoundedIterFunc(false, time.Date(5783, 1, 1, 0, 0, 0, 0, time.UTC), time.Now(), func(rec Record) bool {
if rec.Key == nil {
t.Fatalf("TestBoundedIterFunc failed: %v", nilValErr)
t.Fatal(nilValErr)
}
return false
}); err != nil {
t.Fatal(err)
}); err == nil {
t.Fatal("Values fall between or are equal to the given bounds when it should not have returned bounds.")
}
}

Expand Down
4 changes: 2 additions & 2 deletions keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestBoundedKeysWithNoBoundsReturned(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if _, err := sm.BoundedKeys(time.Now().Add(-1*time.Microsecond), time.Now()); err != nil {
t.Fatal(err)
if val, err := sm.BoundedKeys(time.Date(5783, 1, 1, 0, 0, 0, 0, time.UTC), time.Now()); err == nil {
t.Fatalf("Values fall between or are equal to the given bounds when it should not have returned bounds: %+v", sm.idx[val[0]])
}
}

0 comments on commit 4fa6095

Please sign in to comment.