Skip to content

Commit

Permalink
Also step over boundaries in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
notbdu committed Jan 19, 2019
1 parent af02562 commit e09155a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/io/int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func TestVarintBytes(t *testing.T) {
for idx := 0; idx < len(upperBounds); idx++ {
require.Equal(t, binary.PutVarint(buf, upperBounds[idx]), VarintBytes(upperBounds[idx]))
require.Equal(t, binary.PutVarint(buf, lowerBounds[idx]), VarintBytes(lowerBounds[idx]))
// Also step over boundaries as a sanity check.
require.Equal(t, binary.PutVarint(buf, upperBounds[idx]+1), VarintBytes(upperBounds[idx]+1))
require.Equal(t, binary.PutVarint(buf, lowerBounds[idx]-1), VarintBytes(lowerBounds[idx]-1))
}
require.Equal(t, binary.PutVarint(buf, math.MaxInt64), VarintBytes(math.MaxInt64))
require.Equal(t, binary.PutVarint(buf, math.MinInt64), VarintBytes(math.MinInt64))
Expand Down

0 comments on commit e09155a

Please sign in to comment.