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 4718e44
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions commands/upload/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestUploadPropertiesComposition(t *testing.T) {

cwdPath, err := paths.Getwd()
require.NoError(t, err)
cwd := cwdPath.String()
cwd := strings.ReplaceAll(cwdPath.String(), "\\", "/")

tests := []test{
// 0: classic upload, requires port
Expand Down 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 4718e44

Please sign in to comment.