From c4f0db497b6c8de141ace0a21581003e42cbe418 Mon Sep 17 00:00:00 2001 From: Fabian Holler Date: Wed, 3 Jan 2024 12:54:30 +0100 Subject: [PATCH] fixup! fixup! fixup! exec: refactor command execution --- internal/exec/command_test.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/internal/exec/command_test.go b/internal/exec/command_test.go index 234a7ff9..d18b58e5 100644 --- a/internal/exec/command_test.go +++ b/internal/exec/command_test.go @@ -9,16 +9,7 @@ import ( func TestCombinedStdoutOutput(t *testing.T) { ctx := context.Background() - const echoStr = "helloWorld!" - - // Windows returns StrOutput with surrounding quotation marks - var expected string - // TODO: use build tags for OS specific tests instead - if runtime.GOOS == "windows" { - expected = fmt.Sprintf("\"%s\"", echoStr) - } else { - expected = echoStr - } + const echoStr = "hello World!" var res *ResultOut var err error @@ -37,8 +28,8 @@ func TestCombinedStdoutOutput(t *testing.T) { t.Fatal(res.ExpectSuccess()) } - if res.StrOutput() != expected { - t.Errorf("expected output '%s', got '%s'", expected, res.StrOutput()) + if res.StrOutput() != echoStr { + t.Errorf("expected output '%s', got '%s'", echoStr, res.StrOutput()) } }