Skip to content

Commit

Permalink
Handle windows quirks on command output
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Sep 17, 2020
1 parent 086e0e6 commit 7701131
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands/upload/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ func TestUploadPropertiesComposition(t *testing.T) {
require.Error(t, err)
} else {
require.NoError(t, err)
out := strings.Split(outStream.String(), "\n")
outFiltered := strings.ReplaceAll(outStream.String(), "\r", "")
outFiltered = strings.ReplaceAll(outFiltered, "\\", "/")
out := strings.Split(outFiltered, "\n")
// With verbose disable, the upload will output at least 2 lines:
// - the output of the command (1 or 2 lines)
// - an empty line
Expand Down Expand Up @@ -231,7 +233,9 @@ func TestUploadPropertiesComposition(t *testing.T) {
require.Error(t, err)
} else {
require.NoError(t, err)
out := strings.Split(outStream.String(), "\n")
outFiltered := strings.ReplaceAll(outStream.String(), "\r", "")
outFiltered = strings.ReplaceAll(outFiltered, "\\", "/")
out := strings.Split(outFiltered, "\n")
// With verbose enabled, the upload will output at least 3 lines:
// - the first command line that the cli is going to run
// - the output of the first command
Expand Down

0 comments on commit 7701131

Please sign in to comment.