Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Make equality fuzzy in TestGetWithin (#631)
Browse files Browse the repository at this point in the history
This should prevent a sporadic test failure when the time.Now() value in the
test initialization doesn't match with the time.Now() inside the getWithin
function.

Fixes #631
  • Loading branch information
ASzc authored Jun 5, 2020
1 parent 48c72c0 commit 3f64894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func TestGetWithin(t *testing.T) {
},
}
for _, x := range cs {
assert.Equal(t, x.Expected, getWithin(x.Expires, x.Percent))
assert.InDelta(t, x.Expected, getWithin(x.Expires, x.Percent), 1000000001)
}
}

Expand Down

0 comments on commit 3f64894

Please sign in to comment.