1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

simplify getVariables() and improve nested variables support

/cc @smyrman
This commit is contained in:
Andrey Nering
2017-11-17 00:50:04 -02:00
parent 2508bed363
commit 9619c7f54d
2 changed files with 39 additions and 73 deletions

View File

@@ -72,17 +72,16 @@ func TestVars(t *testing.T) {
Target: "default",
TrimSpace: true,
Files: map[string]string{
// hello task:
"foo.txt": "foo",
"bar.txt": "bar",
"baz.txt": "baz",
"tmpl_foo.txt": "foo",
"tmpl_bar.txt": "<no value>",
"tmpl_bar.txt": "bar",
"tmpl_foo2.txt": "foo2",
"tmpl_bar2.txt": "bar2",
"shtmpl_foo.txt": "foo",
"shtmpl_foo2.txt": "foo2",
"nestedtmpl_foo.txt": "{{.FOO}}",
"nestedtmpl_foo.txt": "<no value>",
"nestedtmpl_foo2.txt": "foo2",
"foo2.txt": "foo2",
"bar2.txt": "bar2",
@@ -90,10 +89,10 @@ func TestVars(t *testing.T) {
"tmpl2_foo.txt": "<no value>",
"tmpl2_foo2.txt": "foo2",
"tmpl2_bar.txt": "<no value>",
"tmpl2_bar2.txt": "<no value>",
"tmpl2_bar2.txt": "bar2",
"shtmpl2_foo.txt": "<no value>",
"shtmpl2_foo2.txt": "foo2",
"nestedtmpl2_foo2.txt": "{{.FOO2}}",
"nestedtmpl2_foo2.txt": "<no value>",
"override.txt": "bar",
},
}