From 7701131ab72acd4567a6f17da740f0fdb2d44e08 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 17 Sep 2020 10:30:13 +0200 Subject: [PATCH] Handle windows quirks on command output --- commands/upload/upload_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/upload/upload_test.go b/commands/upload/upload_test.go index 4106dd3f4e2..ee5b96f4cfa 100644 --- a/commands/upload/upload_test.go +++ b/commands/upload/upload_test.go @@ -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 @@ -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