Skip to content

Commit

Permalink
fixup! fixup! fixup! exec: refactor command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
fho committed Jan 3, 2024
1 parent 8512594 commit c4f0db4
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions internal/exec/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
}
}

Expand Down

0 comments on commit c4f0db4

Please sign in to comment.