]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: accept Windows line-ending in TestTrampolineCgo
authorCherry Mui <cherryyz@google.com>
Thu, 27 May 2021 14:11:42 +0000 (10:11 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 27 May 2021 18:01:11 +0000 (18:01 +0000)
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 <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/link_test.go

index 8805ff1f02cacbb4cc4db2f59af85a5ab51227a3..4d6bc76aca82a588ace4b2ca8f48c010b195244b 100644 (file)
@@ -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)
        }
 }