Skip to content

Commit

Permalink
Cherry-pick CL 532816 "runtime: normalize line endings in TestGdbPython"
Browse files Browse the repository at this point in the history
  • Loading branch information
dagood committed Oct 5, 2023
1 parent f0a48a4 commit 5e18ef1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions patches/0009-runtime-normalize-line-endings-in-TestGdbPython.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: qmuntal <[email protected]>
Date: Thu, 5 Oct 2023 12:02:43 +0200
Subject: [PATCH] runtime: normalize line endings in TestGdbPython

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
---
src/runtime/runtime-gdb_test.go | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go
index 8c759bf4066370..ced71ca4767d0f 100644
--- a/src/runtime/runtime-gdb_test.go
+++ b/src/runtime/runtime-gdb_test.go
@@ -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

0 comments on commit 5e18ef1

Please sign in to comment.