Skip to content

Commit

Permalink
Fix stdout separator
Browse files Browse the repository at this point in the history
  • Loading branch information
danawoodman committed Feb 27, 2024
1 parent 7022a92 commit 3831b5e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestCng(t *testing.T) {
write(".git/foo.txt")
write("node_modules/foo.txt")
},
stdout: []string{""},
stdout: []string{},
},
// todo: should report helpful error if missing pattern
// {
Expand Down Expand Up @@ -149,13 +149,16 @@ func TestCng(t *testing.T) {
stdout := stdoutBuf.String()
stderr := stderrBuf.String()

var sep string
if runtime.GOOS == "windows" {
sep = "\r"
} else {
sep = "\n"
var testStdout string
if len(test.stdout) > 0 {
var sep string
if runtime.GOOS == "windows" {
sep = "\r"
} else {
sep = "\n"
}
testStdout = strings.Join(test.stdout, sep) + sep
}
testStdout := strings.Join(test.stdout, sep)
assert.Equal(t, testStdout, stdout)
assert.Equal(t, test.stderr, stderr)
})
Expand Down

0 comments on commit 3831b5e

Please sign in to comment.