Skip to content

Commit ef789b3

Browse files
rsneddsymonds
authored andcommitted
s2: Add -benchmark_brute_force flag to aid in testing.
Updates #59. Signed-off-by: David Symonds <dsymonds@golang.org>
1 parent 75f8884 commit ef789b3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

s2/s2_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package s2
1616

1717
import (
18+
"flag"
1819
"io"
1920
"math"
2021
"math/rand"
@@ -25,6 +26,12 @@ import (
2526
"github.com/golang/geo/s1"
2627
)
2728

29+
var (
30+
// To set in testing add "--benchmark_brute_force=true" to your test command.
31+
benchmarkBruteForce = flag.Bool("benchmark_brute_force", false,
32+
"When set, use brute force algorithms in benchmarking.")
33+
)
34+
2835
// float64Eq reports whether the two values are within the default epsilon.
2936
func float64Eq(x, y float64) bool { return float64Near(x, y, epsilon) }
3037

0 commit comments

Comments
 (0)