From f707e53fd52284e58b9ea5d7889ad360d34d5116 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 24 Feb 2025 09:57:04 +0100 Subject: 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 Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- src/syscall/exec_freebsd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/syscall') diff --git a/src/syscall/exec_freebsd_test.go b/src/syscall/exec_freebsd_test.go index 2e9513f098..34c4b9e2bb 100644 --- a/src/syscall/exec_freebsd_test.go +++ b/src/syscall/exec_freebsd_test.go @@ -88,7 +88,7 @@ func TestJailAttach(t *testing.T) { t.Fatalf("Build of syscall in jail root failed, output %v, err %v", o, err) } - cmd = exec.Command("/syscall.test", "-test.run=TestJailAttach", "/") + cmd = exec.Command("/syscall.test", "-test.run=^TestJailAttach$", "/") cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1") cmd.SysProcAttr = &syscall.SysProcAttr{Jail: jid} out, err := cmd.CombinedOutput() -- cgit v1.3-6-g1900