Skip to content
Myr

fix: exec tests on windows

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Windows doesn't have true/false binaries

authored by Ayman Bagabas · committed by Ayman Bagabas · parent d928d8d · Browse files · 1 file+19 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+19 added−12 removed

  • other:+19 added−12 removed

1 file+19 added−12 removed

modified:exec_test.go+19 added-12 removed
1 unmodified line
23import (4 "bytes"5 "os/exec"6 "runtime"7 "testing"8)910type execFinishedMsg struct{ err error }
26 unmodified lines
37 return "\n"38}3940func TestTeaExec(t *testing.T) {40 tests := []struct {41 type test struct {42 name string43 cmd string44 expectErr bool44 }{45 }46 tests := []test{47 {46 name: "true",47 cmd: "true",48 expectErr: false,49 },50 {51 name: "false",52 cmd: "false",53 expectErr: true,54 },55 {48 name: "invalid command",49 cmd: "invalid",50 expectErr: true,51 },52 }5354 if runtime.GOOS != "windows" {55 tests = append(tests, []test{56 {57 name: "true",58 cmd: "true",59 expectErr: false,60 },61 {62 name: "false",63 cmd: "false",64 expectErr: true,65 },66 }...)67 }6869 for _, test := range tests {70 t.Run(test.name, func(t *testing.T) {71 var buf bytes.Buffer72 var in bytes.Buffer
16 unmodified lines