mirror of
https://github.com/go-task/task.git
synced 2025-05-13 22:16:31 +02:00
fix: fuzzy model was not instanciated (#2200)
* fix: fuzzy model was not instanciated * add test * add test
This commit is contained in:
parent
1c35358fcc
commit
a33544101a
@ -937,3 +937,24 @@ func TestVarInheritance(t *testing.T) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestFuzzyModel(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
NewExecutorTest(t,
|
||||||
|
WithName("fuzzy"),
|
||||||
|
WithExecutorOptions(
|
||||||
|
task.WithDir("testdata/fuzzy"),
|
||||||
|
),
|
||||||
|
WithTask("instal"),
|
||||||
|
WithRunError(),
|
||||||
|
)
|
||||||
|
|
||||||
|
NewExecutorTest(t,
|
||||||
|
WithName("not-fuzzy"),
|
||||||
|
WithExecutorOptions(
|
||||||
|
task.WithDir("testdata/fuzzy"),
|
||||||
|
),
|
||||||
|
WithTask("install"),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
2
setup.go
2
setup.go
@ -95,7 +95,7 @@ func (e *Executor) readTaskfile(node taskfile.Node) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *Executor) setupFuzzyModel() {
|
func (e *Executor) setupFuzzyModel() {
|
||||||
if e.Taskfile != nil {
|
if e.Taskfile == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
testdata/fuzzy/Taskfile.yml
vendored
Normal file
4
testdata/fuzzy/Taskfile.yml
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version: 3
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
install: echo 'install'
|
1
testdata/fuzzy/testdata/TestFuzzyModel-fuzzy-err-run.golden
vendored
Normal file
1
testdata/fuzzy/testdata/TestFuzzyModel-fuzzy-err-run.golden
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
task: Task "instal" does not exist. Did you mean "install"?
|
1
testdata/fuzzy/testdata/TestFuzzyModel-fuzzy.golden
vendored
Normal file
1
testdata/fuzzy/testdata/TestFuzzyModel-fuzzy.golden
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
task: No tasks with description available. Try --list-all to list all tasks
|
2
testdata/fuzzy/testdata/TestFuzzyModel-not-fuzzy.golden
vendored
Normal file
2
testdata/fuzzy/testdata/TestFuzzyModel-not-fuzzy.golden
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
task: [install] echo 'install'
|
||||||
|
install
|
Loading…
x
Reference in New Issue
Block a user