Skip to content

Commit

Permalink
Merge pull request #675 from dswarbrick/fix-32bit-overflows
Browse files Browse the repository at this point in the history
Fix overflows of untyped int constants on 32-bit
  • Loading branch information
beorn7 committed Aug 13, 2024
2 parents 1dade5b + 008d7b8 commit 79c0459
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers/templates/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestHumanizeTimestamp(t *testing.T) {
{name: "negative", input: -1, expected: "1969-12-31 23:59:59 +0000 UTC"},
{name: "one", input: 1, expected: "1970-01-01 00:00:01 +0000 UTC"},
{name: "past", input: 1234567, expected: "1970-01-15 06:56:07 +0000 UTC"},
{name: "future", input: 9223372036, expected: "2262-04-11 23:47:16 +0000 UTC"},
{name: "future", input: int64(9223372036), expected: "2262-04-11 23:47:16 +0000 UTC"},
// Uint
{name: "zero", input: uint64(0), expected: "1970-01-01 00:00:00 +0000 UTC"},
{name: "one", input: uint64(1), expected: "1970-01-01 00:00:01 +0000 UTC"},
Expand Down Expand Up @@ -118,6 +118,6 @@ func TestHumanizeTimestamp(t *testing.T) {
}

func TestHumanizeTimestampError(t *testing.T) {
_, err := HumanizeTimestamp(math.MaxInt64)
_, err := HumanizeTimestamp(int64(math.MaxInt64))
require.Error(t, err)
}

0 comments on commit 79c0459

Please sign in to comment.