refactor: unify how executor tests are written (#2042)

* feat: use TaskTest for executor tests

* feat: more tests

* feat: separate tests for executing and formatting with new functional options that work for both test types

* feat: formatter tests

* refactor: more tests
This commit is contained in:
Pete Davison
2025-03-31 17:53:58 +01:00
committed by GitHub
parent 180fcef364
commit 4736bc2734
175 changed files with 1706 additions and 1111 deletions

View File

@@ -12,33 +12,33 @@ tasks:
GERMAN: "Welt!"
deps:
- task: write-file
vars: {CONTENT: Dependence1, FILE: dep1.txt}
vars: {CONTENT: Dependence1}
- task: write-file
vars: {CONTENT: Dependence2, FILE: dep2.txt}
vars: {CONTENT: Dependence2}
- task: write-file
vars: {CONTENT: "{{.SPANISH|replace \"mundo\" \"dependencia\"}}", FILE: spanish-dep.txt}
vars: {CONTENT: "{{.SPANISH|replace \"mundo\" \"dependencia\"}}"}
cmds:
- task: write-file
vars: {CONTENT: Hello, FILE: hello.txt}
vars: {CONTENT: Hello}
- task: write-file
vars: {CONTENT: "$echo 'World'", FILE: world.txt}
vars: {CONTENT: "$echo 'World'"}
- task: write-file
vars: {CONTENT: "!", FILE: exclamation.txt}
vars: {CONTENT: "!"}
- task: write-file
vars: {CONTENT: "{{.SPANISH}}", FILE: spanish.txt}
vars: {CONTENT: "{{.SPANISH}}"}
- task: write-file
vars: {CONTENT: "{{.PORTUGUESE}}", FILE: portuguese.txt}
vars: {CONTENT: "{{.PORTUGUESE}}"}
- task: write-file
vars: {CONTENT: "{{.GERMAN}}", FILE: german.txt}
vars: {CONTENT: "{{.GERMAN}}"}
- task: non-default
write-file:
cmds:
- echo {{.CONTENT}} > {{.FILE}}
- echo {{.CONTENT}}
non-default:
vars:
PORTUGUESE: "{{.PORTUGUESE_HELLO_WORLD}}"
cmds:
- task: write-file
vars: {CONTENT: "{{.PORTUGUESE}}", FILE: portuguese2.txt}
vars: {CONTENT: "{{.PORTUGUESE}}"}