(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestLocateFile(t *testing.T) { |
| 10 | // specify target file path |
| 11 | _, err := locateFile(tmpl("plugin/debugtalk.go"), PluginGoSourceFile) |
| 12 | if !assert.Nil(t, err) { |
| 13 | t.Fatal() |
| 14 | } |
| 15 | |
| 16 | // specify path with the same dir |
| 17 | _, err = locateFile(tmpl("plugin/debugtalk.py"), PluginGoSourceFile) |
| 18 | if !assert.Nil(t, err) { |
| 19 | t.Fatal() |
| 20 | } |
| 21 | |
| 22 | // specify target file path dir |
| 23 | _, err = locateFile(tmpl("plugin/"), PluginGoSourceFile) |
| 24 | if !assert.Nil(t, err) { |
| 25 | t.Fatal() |
| 26 | } |
| 27 | |
| 28 | // specify wrong path |
| 29 | _, err = locateFile(".", PluginGoSourceFile) |
| 30 | if !assert.Error(t, err) { |
| 31 | t.Fatal() |
| 32 | } |
| 33 | _, err = locateFile("/abc", PluginGoSourceFile) |
| 34 | if !assert.Error(t, err) { |
| 35 | t.Fatal() |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestLocatePythonPlugin(t *testing.T) { |
| 40 | _, err := locatePlugin(tmpl("plugin/debugtalk.py")) |
nothing calls this directly
no test coverage detected