Skip to content

Commit

Permalink
fix: tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
debugtalk committed Jan 18, 2024
1 parent e695403 commit 0ffb909
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
File renamed without changes.
21 changes: 21 additions & 0 deletions myexec/cmd_windows_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package myexec

import "testing"

func TestRunShell(t *testing.T) {

Check failure on line 5 in myexec/cmd_windows_test.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, windows-latest)

TestRunShell redeclared in this block

Check failure on line 5 in myexec/cmd_windows_test.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, windows-latest)

TestRunShell redeclared in this block

Check failure on line 5 in myexec/cmd_windows_test.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, windows-latest)

TestRunShell redeclared in this block
exitCode, err := RunShell("echo hello world")
if err != nil {
t.Fatal(err)
}
if exitCode != 0 {
t.Fatalf("expected exit code 0, got %d", exitCode)
}

exitCode, err = RunShell("dir /b /s; exit /b 3")
if err == nil {
t.Fatal(err)
}
if exitCode != 3 {
t.Fatalf("expected exit code 3, got %d", exitCode)
}
}

0 comments on commit 0ffb909

Please sign in to comment.