]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/testdata/script: restrict test to check only exe name
authorBrian Gabin <bpgabin@gmail.com>
Mon, 21 Oct 2024 04:58:08 +0000 (21:58 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 20 Nov 2024 18:45:12 +0000 (18:45 +0000)
Avoid test failures caused by 'v2' in user environment paths.
Modify the test to check only the output executable name and ensure it is not 'v2', rather than inspecting the entire path.

Fixes #67989

Change-Id: Ida2131f6c9b41724df1b6b5e31413252c5009d25
Reviewed-on: https://go-review.googlesource.com/c/go/+/621315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
src/cmd/go/testdata/script/mod_install_versioned.txt

index 627a9a81b0bead5747f3ae5793c8e14c150a3225..51b78968e98399ca1a1a0f40500c8b86e65fd5fa 100644 (file)
@@ -7,7 +7,7 @@ stdout 'fortune(\.exe)?$'
 
 go get rsc.io/fortune/v2
 go list -f '{{.Target}}' rsc.io/fortune/v2
-! stdout v2
+! stdout 'v2(\.exe)?$'
 stdout 'fortune(\.exe)?$'
 
 -- go.mod --