Skip to content

Commit

Permalink
Update unit test to reflect new bash path on GitHub Actions Windows r…
Browse files Browse the repository at this point in the history
…unner.
  • Loading branch information
mitchell-as committed Sep 11, 2024
1 parent 544d342 commit dbf0ec8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/subshell/subshell_win_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,24 @@ func setup(t *testing.T) {
func TestBash(t *testing.T) {
setup(t)

os.Setenv("SHELL", `C:\Program Files\bash.exe`)
shellPath := `C:\Program Files\Git\usr\bin\bash.exe`
os.Setenv("SHELL", shellPath)
cfg, err := config.New()
require.NoError(t, err)
subs := New(cfg)
assert.Equal(t, `C:\Program Files\bash.exe`, subs.Binary())
assert.Equal(t, shellPath, subs.Binary())

}

func TestBashDontEscapeSpace(t *testing.T) {
setup(t)

// Reproduce bug in which paths are being incorrectly escaped on windows
os.Setenv("SHELL", `C:\Program\ Files\bash.exe`)
os.Setenv("SHELL", `C:\Program\ Files\Git\usr\bin\bash.exe`)
cfg, err := config.New()
require.NoError(t, err)
subs := New(cfg)
assert.Equal(t, `C:\Program Files\bash.exe`, subs.Binary())
assert.Equal(t, `C:\Program Files\Git\usr\bin\bash.exe`, subs.Binary())
}

func TestRunCommandError(t *testing.T) {
Expand Down

0 comments on commit dbf0ec8

Please sign in to comment.