]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: normalize line endings in TestGdbPython
authorqmuntal <quimmuntal@gmail.com>
Thu, 5 Oct 2023 10:02:43 +0000 (12:02 +0200)
committerGopher Robot <gobot@golang.org>
Mon, 9 Oct 2023 21:49:03 +0000 (21:49 +0000)
TestGdbPython fails on some Windows setups because the line endings in
the output of the gdb command can potentially be CRLF, but the test
expects LF.

This CL changes the test to normalize the line endings.

Change-Id: Iada9c37dc98249ac3c5f1edca4a657c51d4382a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/532816
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Auto-Submit: Quim Muntal <quimmuntal@gmail.com>

src/runtime/runtime-gdb_test.go

index 8c759bf406637095d841eb0c9fbda6bfebe40318..ced71ca4767d0f9d070ed15ddbdd985fbc4a3377 100644 (file)
@@ -275,6 +275,7 @@ func testGdbPython(t *testing.T, cgo bool) {
                t.Fatalf("gdb exited with error: %v", err)
        }
 
+       got = bytes.ReplaceAll(got, []byte("\r\n"), []byte("\n")) // normalize line endings
        firstLine, _, _ := bytes.Cut(got, []byte("\n"))
        if string(firstLine) != "Loading Go Runtime support." {
                // This can happen when using all.bash with