aboutsummaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2025-02-24 09:57:04 +0100
committerQuim Muntal <quimmuntal@gmail.com>2025-02-25 10:58:29 -0800
commitf707e53fd52284e58b9ea5d7889ad360d34d5116 (patch)
treec70e6c543a601d92e8f47cfde52e47be116b3cfe /src/math
parentcc16fb52e6f1eafaee468f8563525ec391e016f5 (diff)
downloadgo-f707e53fd52284e58b9ea5d7889ad360d34d5116.tar.xz
all: surround -test.run arguments with ^$
If the -test.run value is not surrounded by ^$ then any test that matches the -test.run value will be run. This is normally not the desired behavior, as it can lead to unexpected tests being run. Change-Id: I3447aaebad5156bbef7f263cdb9f6b8c32331324 Reviewed-on: https://go-review.googlesource.com/c/go/+/651956 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/math')
-rw-r--r--src/math/rand/default_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/math/rand/default_test.go b/src/math/rand/default_test.go
index b42cd165c8..0ba51b4dbd 100644
--- a/src/math/rand/default_test.go
+++ b/src/math/rand/default_test.go
@@ -37,7 +37,7 @@ func TestDefaultRace(t *testing.T) {
i := i
t.Run(strconv.Itoa(i), func(t *testing.T) {
t.Parallel()
- cmd := testenv.Command(t, testenv.Executable(t), "-test.run=TestDefaultRace")
+ cmd := testenv.Command(t, testenv.Executable(t), "-test.run=^TestDefaultRace$")
cmd = testenv.CleanCmdEnv(cmd)
cmd.Env = append(cmd.Env, fmt.Sprintf("GO_RAND_TEST_HELPER_CODE=%d", i/2))
if i%2 != 0 {