Skip to content

Commit

Permalink
add maxInt in test files
Browse files Browse the repository at this point in the history
  • Loading branch information
TapirLiu committed Apr 29, 2024
1 parent 191bb36 commit a7a3704
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bytes/bytes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ func repeat(b []byte, count int) (err error) {

// See Issue golang.org/issue/16237
func TestRepeatCatchesOverflow(t *testing.T) {
const maxInt = int(^uint(0) >> 1)
tests := [...]struct {
s string
count int
Expand Down
1 change: 1 addition & 0 deletions src/strings/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,7 @@ func repeat(s string, count int) (err error) {

// See Issue golang.org/issue/16237
func TestRepeatCatchesOverflow(t *testing.T) {
const maxInt = int(^uint(0) >> 1)
tests := [...]struct {
s string
count int
Expand Down

0 comments on commit a7a3704

Please sign in to comment.