MCPcopy
hub / github.com/go-task/task / TestArgs

Function TestArgs

args/args_test.go:14–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestArgs(t *testing.T) {
15 t.Parallel()
16
17 tests := []struct {
18 Args []string
19 ExpectedCalls []*task.Call
20 ExpectedGlobals *ast.Vars
21 }{
22 {
23 Args: []string{"task-a", "task-b", "task-c"},
24 ExpectedCalls: []*task.Call{
25 {Task: "task-a"},
26 {Task: "task-b"},
27 {Task: "task-c"},
28 },
29 },
30 {
31 Args: []string{"task-a", "FOO=bar", "task-b", "task-c", "BAR=baz", "BAZ=foo"},
32 ExpectedCalls: []*task.Call{
33 {Task: "task-a"},
34 {Task: "task-b"},
35 {Task: "task-c"},
36 },
37 ExpectedGlobals: ast.NewVars(
38 &ast.VarElement{
39 Key: "FOO",
40 Value: ast.Var{
41 Value: "bar",
42 },
43 },
44 &ast.VarElement{
45 Key: "BAR",
46 Value: ast.Var{
47 Value: "baz",
48 },
49 },
50 &ast.VarElement{
51 Key: "BAZ",
52 Value: ast.Var{
53 Value: "foo",
54 },
55 },
56 ),
57 },
58 {
59 Args: []string{"task-a", "CONTENT=with some spaces"},
60 ExpectedCalls: []*task.Call{
61 {Task: "task-a"},
62 },
63 ExpectedGlobals: ast.NewVars(
64 &ast.VarElement{
65 Key: "CONTENT",
66 Value: ast.Var{
67 Value: "with some spaces",
68 },
69 },
70 ),
71 },

Callers

nothing calls this directly

Calls 4

NewVarsFunction · 0.92
ParseFunction · 0.92
RunMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…