mirror of
https://github.com/go-task/task.git
synced 2025-08-08 22:36:57 +02:00
Added tests for new inport taskfile logic
This commit is contained in:
10
task_test.go
10
task_test.go
@@ -540,9 +540,13 @@ func TestIncludes(t *testing.T) {
|
||||
Target: "default",
|
||||
TrimSpace: true,
|
||||
Files: map[string]string{
|
||||
"main.txt": "main",
|
||||
"included_directory.txt": "included_directory",
|
||||
"included_taskfile.txt": "included_taskfile",
|
||||
"main.txt": "main",
|
||||
"included_directory.txt": "included_directory",
|
||||
"included_directory_without_dir.txt": "included_directory_without_dir",
|
||||
"included_taskfile_without_dir.txt": "included_taskfile_without_dir",
|
||||
"./module2/included_directory_with_dir.txt": "included_directory_with_dir",
|
||||
"./module2/included_taskfile_with_dir.txt": "included_taskfile_with_dir",
|
||||
"./module3/os_related.txt": runtime.GOOS,
|
||||
},
|
||||
}
|
||||
tt.Run(t)
|
||||
|
18
testdata/includes/Taskfile.yml
vendored
18
testdata/includes/Taskfile.yml
vendored
@@ -3,6 +3,19 @@ version: '2'
|
||||
includes:
|
||||
included: ./included
|
||||
included_taskfile: ./Taskfile2.yml
|
||||
included_without_dir:
|
||||
taskfile: ./module1
|
||||
included_taskfile_without_dir:
|
||||
taskfile: ./module1/Taskfile.yml
|
||||
included_with_dir:
|
||||
taskfile: ./module2
|
||||
dir: ./module2
|
||||
included_taskfile_with_dir:
|
||||
taskfile: ./module2/Taskfile.yml
|
||||
dir: ./module2
|
||||
os_related:
|
||||
taskfile: ./module3/CustomTaskfile.yml
|
||||
dir: ./module3
|
||||
|
||||
tasks:
|
||||
default:
|
||||
@@ -10,6 +23,11 @@ tasks:
|
||||
- task: gen
|
||||
- task: included:gen
|
||||
- task: included_taskfile:gen
|
||||
- task: included_without_dir:gen_file
|
||||
- task: included_taskfile_without_dir:gen_dir
|
||||
- task: included_with_dir:gen_file
|
||||
- task: included_taskfile_with_dir:gen_dir
|
||||
- task: os_related:gen
|
||||
|
||||
gen:
|
||||
cmds:
|
||||
|
9
testdata/includes/module1/Taskfile.yml
vendored
Normal file
9
testdata/includes/module1/Taskfile.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
gen_dir:
|
||||
cmds:
|
||||
- echo included_directory_without_dir > included_directory_without_dir.txt
|
||||
gen_file:
|
||||
cmds:
|
||||
- echo included_taskfile_without_dir > included_taskfile_without_dir.txt
|
9
testdata/includes/module2/Taskfile.yml
vendored
Normal file
9
testdata/includes/module2/Taskfile.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
gen_dir:
|
||||
cmds:
|
||||
- echo included_directory_with_dir > included_directory_with_dir.txt
|
||||
gen_file:
|
||||
cmds:
|
||||
- echo included_taskfile_with_dir > included_taskfile_with_dir.txt
|
6
testdata/includes/module3/CustomTaskfile.yml
vendored
Normal file
6
testdata/includes/module3/CustomTaskfile.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
gen:
|
||||
cmds:
|
||||
- echo "INVALID" > os_related.txt
|
6
testdata/includes/module3/CustomTaskfile_darwin.yml
vendored
Normal file
6
testdata/includes/module3/CustomTaskfile_darwin.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
gen:
|
||||
cmds:
|
||||
- echo "darwin" > os_related.txt
|
6
testdata/includes/module3/CustomTaskfile_linux.yml
vendored
Normal file
6
testdata/includes/module3/CustomTaskfile_linux.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
gen:
|
||||
cmds:
|
||||
- echo "linux" > os_related.txt
|
6
testdata/includes/module3/CustomTaskfile_windows.yml
vendored
Normal file
6
testdata/includes/module3/CustomTaskfile_windows.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
gen:
|
||||
cmds:
|
||||
- echo "windows" > os_related.txt
|
Reference in New Issue
Block a user