From 834858fa5f6ecf980116c9ab7a2927931fe54c85 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 17 Oct 2022 16:25:33 -0400 Subject: [PATCH] cmd/go: fix TestScript/test_fuzz_mutate_crash for shorter fuzz names Fixes longtest builders. Change-Id: I8b375bcfc91695d5810493b972801df82c6c1b7c Reviewed-on: https://go-review.googlesource.com/c/go/+/443381 Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot Run-TryBot: Russ Cox Reviewed-by: Bryan Mills --- src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt b/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt index d2ded27f85..aa4aa854d0 100644 --- a/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt +++ b/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt @@ -20,7 +20,7 @@ go run check_testdata.go FuzzWithBug # Now, the failing bytes should have been added to the seed corpus for # the target, and should fail when run without fuzzing. ! go test -stdout 'FuzzWithBug/[a-f0-9]{64}' +stdout 'FuzzWithBug/[a-f0-9]{16}' stdout 'this input caused a crash!' ! go test -run=FuzzWithNilPanic -fuzz=FuzzWithNilPanic -fuzztime=100x -fuzzminimizetime=1000x @@ -315,7 +315,7 @@ func main() { } // The hash of the bytes in the file should match the filename. h := []byte(fmt.Sprintf("%x", sha256.Sum256(contents))) - if !bytes.Equal([]byte(fname), h) { + if !bytes.HasPrefix(h, []byte(fname)) { fmt.Fprintf(os.Stderr, "hash of bytes %q does not match filename %q\n", h, fname) os.Exit(1) } -- 2.48.1