1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

Add support for 'platforms' in both task and command (#980)

This commit is contained in:
Lea Anthony
2023-01-07 11:38:35 +11:00
committed by GitHub
parent 63c50d13ee
commit aa6c7e4b94
10 changed files with 295 additions and 0 deletions

View File

@ -1696,3 +1696,14 @@ func TestUserWorkingDirectory(t *testing.T) {
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "default"}))
assert.Equal(t, fmt.Sprintf("%s\n", wd), buff.String())
}
func TestPlatforms(t *testing.T) {
var buff bytes.Buffer
e := task.Executor{
Dir: "testdata/platforms",
Stdout: &buff,
Stderr: &buff,
}
assert.NoError(t, e.Setup())
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "build-" + runtime.GOOS}))
assert.Equal(t, fmt.Sprintf("task: [build-%s] echo 'Running task on %s'\nRunning task on %s\n", runtime.GOOS, runtime.GOOS, runtime.GOOS), buff.String())
}