Skip to content

Commit 9e29a51

Browse files
committed
Fix newline char
1 parent f482a85 commit 9e29a51

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cli/cliui/prompt_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cliui_test
22

33
import (
44
"context"
5+
"runtime"
56
"testing"
67

78
"github.com/spf13/cobra"
@@ -60,8 +61,11 @@ func TestPrompt(t *testing.T) {
6061
ptty.ExpectMatch("Example")
6162
ptty.WriteLine("'this is a")
6263
ptty.WriteLine("test'")
63-
require.Equal(t, `this is a
64-
test`, <-doneChan)
64+
newline := "\n"
65+
if runtime.GOOS == "windows" {
66+
newline = "\r\n"
67+
}
68+
require.Equal(t, "this is a"+newline+"test", <-doneChan)
6569
})
6670
}
6771

0 commit comments

Comments
 (0)