summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Thomas J Faughnan Jr <thomas@faughnan.net> 2024-03-31 01:43:10 -0400
committerGravatar Frédéric Guillot <f@miniflux.net> 2024-04-01 21:02:48 -0700
commit3e0d5de7a3e3d55fb19d635feb0e6d8da5f6f7a2 (patch)
tree5a9b3dfeb8f5d1ae7f7a88c04b2f1e8be88be2e2
parent0336774e8c70409e10e3ffcf1cebe152d252a57c (diff)
downloadv2-3e0d5de7a3e3d55fb19d635feb0e6d8da5f6f7a2.tar.gz
v2-3e0d5de7a3e3d55fb19d635feb0e6d8da5f6f7a2.tar.zst
v2-3e0d5de7a3e3d55fb19d635feb0e6d8da5f6f7a2.zip
api tests: use intSize-agnostic random integers
rand.Intn(math.MaxInt64) causes tests to fail on 32-bit architectures. Use the simpler rand.Int() instead, which still provides plenty of room for generating pseudo-random test usernames.
Diffstat (limited to '')
-rw-r--r--internal/api/api_integration_test.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/api/api_integration_test.go b/internal/api/api_integration_test.go
index 141dcf64..9259b590 100644
--- a/internal/api/api_integration_test.go
+++ b/internal/api/api_integration_test.go
@@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"io"
- "math"
"math/rand"
"os"
"strings"
@@ -58,7 +57,7 @@ func (c *integrationTestConfig) isConfigured() bool {
}
func (c *integrationTestConfig) genRandomUsername() string {
- return fmt.Sprintf("%s_%10d", c.testRegularUsername, rand.Intn(math.MaxInt64))
+ return fmt.Sprintf("%s_%10d", c.testRegularUsername, rand.Int())
}
func TestIncorrectEndpoint(t *testing.T) {