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:
@ -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",
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user