Skip to content

Commit

Permalink
use MaxInt64 to replace hard code
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid committed Sep 11, 2019
1 parent d51c8a1 commit 76c9eb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meta/autoid/autoid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ func (*testSuite) TestT(c *C) {
c.Assert(id, Equals, int64(6544))

// Test the MaxInt64 is the upper bound of `alloc` function but not `rebase`.
err = alloc.Rebase(3, int64(9223372036854775806), true)
err = alloc.Rebase(3, int64(math.MaxInt64-1), true)
c.Assert(err, IsNil)
_, err = alloc.Alloc(3)
c.Assert(alloc, NotNil)
err = alloc.Rebase(3, int64(9223372036854775807), true)
err = alloc.Rebase(3, int64(math.MaxInt64), true)
c.Assert(err, IsNil)
}

Expand Down

0 comments on commit 76c9eb6

Please sign in to comment.