Skip to content

Commit 0ffb909

Browse files
committed
fix: tests for windows
1 parent e695403 commit 0ffb909

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

myexec/cmd_windows_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package myexec
2+
3+
import "testing"
4+
5+
func TestRunShell(t *testing.T) {
6+
exitCode, err := RunShell("echo hello world")
7+
if err != nil {
8+
t.Fatal(err)
9+
}
10+
if exitCode != 0 {
11+
t.Fatalf("expected exit code 0, got %d", exitCode)
12+
}
13+
14+
exitCode, err = RunShell("dir /b /s; exit /b 3")
15+
if err == nil {
16+
t.Fatal(err)
17+
}
18+
if exitCode != 3 {
19+
t.Fatalf("expected exit code 3, got %d", exitCode)
20+
}
21+
}

0 commit comments

Comments
 (0)