fix: unittest with failfast

This commit is contained in:
debugtalk
2022-04-16 00:36:38 +08:00
parent fe2c2f170e
commit 8ebb3634fb
14 changed files with 154 additions and 147 deletions

View File

@@ -10,36 +10,36 @@ func TestLocateFile(t *testing.T) {
// specify target file path
_, err := locateFile(templatesDir+"plugin/debugtalk.go", "debugtalk.go")
if !assert.Nil(t, err) {
t.Fail()
t.Fatal()
}
// specify path with the same dir
_, err = locateFile(templatesDir+"plugin/debugtalk.py", "debugtalk.go")
if !assert.Nil(t, err) {
t.Fail()
t.Fatal()
}
// specify target file path dir
_, err = locateFile(templatesDir+"plugin/", "debugtalk.go")
if !assert.Nil(t, err) {
t.Fail()
t.Fatal()
}
// specify wrong path
_, err = locateFile(".", "debugtalk.go")
if !assert.Error(t, err) {
t.Fail()
t.Fatal()
}
_, err = locateFile("/abc", "debugtalk.go")
if !assert.Error(t, err) {
t.Fail()
t.Fatal()
}
}
func TestLocatePythonPlugin(t *testing.T) {
_, err := locatePlugin(templatesDir + "plugin/debugtalk.py")
if !assert.Nil(t, err) {
t.Fail()
t.Fatal()
}
}
@@ -49,6 +49,6 @@ func TestLocateGoPlugin(t *testing.T) {
_, err := locatePlugin(templatesDir + "debugtalk.bin")
if !assert.Nil(t, err) {
t.Fail()
t.Fatal()
}
}