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

feat: use external package for ordered maps (#1797)

This commit is contained in:
Pete Davison
2024-12-30 17:54:36 +00:00
committed by GitHub
parent dbe6e41ac8
commit 2965841eb7
24 changed files with 499 additions and 486 deletions

View File

@ -7,7 +7,6 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"github.com/go-task/task/v3/internal/omap"
"github.com/go-task/task/v3/taskfile/ast"
)
@ -40,15 +39,21 @@ vars:
yamlTaskCall,
&ast.Cmd{},
&ast.Cmd{
Task: "another-task", Vars: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"PARAM1": {Value: "VALUE1"},
"PARAM2": {Value: "VALUE2"},
Task: "another-task",
Vars: ast.NewVars(
&ast.VarElement{
Key: "PARAM1",
Value: ast.Var{
Value: "VALUE1",
},
[]string{"PARAM1", "PARAM2"},
),
},
},
&ast.VarElement{
Key: "PARAM2",
Value: ast.Var{
Value: "VALUE2",
},
},
),
},
},
{
@ -60,14 +65,15 @@ vars:
yamlDeferredCall,
&ast.Cmd{},
&ast.Cmd{
Task: "some_task", Vars: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"PARAM1": {Value: "var"},
Task: "some_task",
Vars: ast.NewVars(
&ast.VarElement{
Key: "PARAM1",
Value: ast.Var{
Value: "var",
},
[]string{"PARAM1"},
),
},
},
),
Defer: true,
},
},
@ -80,15 +86,21 @@ vars:
yamlTaskCall,
&ast.Dep{},
&ast.Dep{
Task: "another-task", Vars: &ast.Vars{
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"PARAM1": {Value: "VALUE1"},
"PARAM2": {Value: "VALUE2"},
Task: "another-task",
Vars: ast.NewVars(
&ast.VarElement{
Key: "PARAM1",
Value: ast.Var{
Value: "VALUE1",
},
[]string{"PARAM1", "PARAM2"},
),
},
},
&ast.VarElement{
Key: "PARAM2",
Value: ast.Var{
Value: "VALUE2",
},
},
),
},
},
}