Skip to content

Commit 5e92c41

Browse files
aarzillialexbrainman
authored andcommitted
runtime: fix TestGdbConst on windows
Some (all?) versions of gdb on windows output "\r\n" as line ending instead of "\n". Fixes #22012 Change-Id: I798204fd9f616d6d2c9c28eb5227fadfc63c0d45 Reviewed-on: https://go-review.googlesource.com/65850 Reviewed-by: Alex Brainman <[email protected]> Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 45395b5 commit 5e92c41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/runtime-gdb_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,11 @@ func TestGdbConst(t *testing.T) {
431431
}
432432
got, _ := exec.Command("gdb", args...).CombinedOutput()
433433

434-
sgot := string(got)
434+
sgot := strings.Replace(string(got), "\r\n", "\n", -1)
435435

436436
t.Logf("output %q", sgot)
437437

438-
if strings.Index(sgot, "\n$1 = 42\n$2 = 18446744073709551615\n$3 = -1\n$4 = 1 '\\001'") < 0 {
438+
if !strings.Contains(sgot, "\n$1 = 42\n$2 = 18446744073709551615\n$3 = -1\n$4 = 1 '\\001'") {
439439
t.Fatalf("output mismatch")
440440
}
441441
}

0 commit comments

Comments
 (0)