summaryrefslogtreecommitdiff
path: root/libgo/go/big/int_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/big/int_test.go')
-rw-r--r--libgo/go/big/int_test.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libgo/go/big/int_test.go b/libgo/go/big/int_test.go
index c0cc9accf1a..9c19dd5da6d 100644
--- a/libgo/go/big/int_test.go
+++ b/libgo/go/big/int_test.go
@@ -716,18 +716,25 @@ var composites = []string{
func TestProbablyPrime(t *testing.T) {
+ nreps := 20
+ if testing.Short() {
+ nreps = 1
+ }
for i, s := range primes {
p, _ := new(Int).SetString(s, 10)
- if !ProbablyPrime(p, 20) {
+ if !ProbablyPrime(p, nreps) {
t.Errorf("#%d prime found to be non-prime (%s)", i, s)
}
}
for i, s := range composites {
c, _ := new(Int).SetString(s, 10)
- if ProbablyPrime(c, 20) {
+ if ProbablyPrime(c, nreps) {
t.Errorf("#%d composite found to be prime (%s)", i, s)
}
+ if testing.Short() {
+ break
+ }
}
}