From db66e9e15d16cfdb555140b26a5f009fd0d23d0e Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Thu, 27 May 2021 10:11:42 -0400 Subject: [PATCH] cmd/link: accept Windows line-ending in TestTrampolineCgo Apparently C printf emits "\r\n" on Windows. Accept that. Change-Id: If87ba41435e3147d3892cfc3fe3a105b066ff0aa Reviewed-on: https://go-review.googlesource.com/c/go/+/322973 Trust: Cherry Mui Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- src/cmd/link/link_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 8805ff1f02..4d6bc76aca 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -698,7 +698,7 @@ func TestTrampolineCgo(t *testing.T) { if err != nil { t.Errorf("executable failed to run: %v\n%s", err, out) } - if string(out) != "hello\n" { + if string(out) != "hello\n" && string(out) != "hello\r\n" { t.Errorf("unexpected output:\n%s", out) } @@ -717,7 +717,7 @@ func TestTrampolineCgo(t *testing.T) { if err != nil { t.Errorf("executable failed to run: %v\n%s", err, out) } - if string(out) != "hello\n" { + if string(out) != "hello\n" && string(out) != "hello\r\n" { t.Errorf("unexpected output:\n%s", out) } }