diff options
author | Alessandro Arzilli <alessandro.arzilli@gmail.com> | 2017-09-25 12:30:41 +0200 |
---|---|---|
committer | Alex Brainman <alex.brainman@gmail.com> | 2017-09-25 11:34:24 +0000 |
commit | 5e92c411284f1757c3531a70530170f1079ee5fc (patch) | |
tree | 783fb0e15e62eddce433e975e305e8fe5d57d3a9 /src/runtime/runtime-gdb_test.go | |
parent | 45395b5ad6d59f418cbe8b93950c9bae6e6f2196 (diff) | |
download | go-5e92c411284f1757c3531a70530170f1079ee5fc.tar.gz go-5e92c411284f1757c3531a70530170f1079ee5fc.zip |
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 <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime-gdb_test.go')
-rw-r--r-- | src/runtime/runtime-gdb_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index 7b035871d5..a190aa28d1 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -431,11 +431,11 @@ func TestGdbConst(t *testing.T) { } got, _ := exec.Command("gdb", args...).CombinedOutput() - sgot := string(got) + sgot := strings.Replace(string(got), "\r\n", "\n", -1) t.Logf("output %q", sgot) - if strings.Index(sgot, "\n$1 = 42\n$2 = 18446744073709551615\n$3 = -1\n$4 = 1 '\\001'") < 0 { + if !strings.Contains(sgot, "\n$1 = 42\n$2 = 18446744073709551615\n$3 = -1\n$4 = 1 '\\001'") { t.Fatalf("output mismatch") } } |