mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-27 21:39:20 +02:00
Maybe 3rd time is the charm! This makes the CI build run on windows too, and fix broken tests/featuers on Windows. Most of the changes are related to ignoring certain tests on windows, or making sure to use the right path separators. More work to do in the future, probably! #4293 --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
29 lines
698 B
Go
29 lines
698 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package shell_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/goreleaser/goreleaser/v2/internal/shell"
|
|
"github.com/goreleaser/goreleaser/v2/internal/testctx"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestRunCommandWindows(t *testing.T) {
|
|
t.Run("simple", func(t *testing.T) {
|
|
require.NoError(t, shell.Run(testctx.New(), "", []string{"cmd.exe", "/c", "echo", "oi"}, []string{}, false))
|
|
})
|
|
|
|
t.Run("cmd failed", func(t *testing.T) {
|
|
require.EqualError(
|
|
t,
|
|
shell.Run(testctx.New(), "", []string{"cmd.exe", "/c", "exit /b 1"}, []string{}, false),
|
|
`shell: 'cmd.exe /c exit /b 1': exit status 1: [no output]`,
|
|
)
|
|
})
|
|
|
|
// TODO: more tests for windows
|
|
}
|