New function for searching and importing plugin
This commit is contained in:
+10
-3
@@ -8,9 +8,16 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func _TestImportPlugin(t *testing.T) {
|
||||
if err := importPlugin([]string{"test-resources"}, "json"); err != nil {
|
||||
t.Errorf("importPlugin() failed: %v", err)
|
||||
func TestImportPlugin(t *testing.T) {
|
||||
t.Setenv("PLUGINS", "${HOME}/go/src/git.portale-stac.it/go")
|
||||
t.Setenv("EXPR_PLUGIN_PATH","${PLUGINS}/expr-json-plugin:${PLUGINS}/expr-csv-plugin")
|
||||
|
||||
gotCount, gotErr := importPluginFromSearchPath("json")
|
||||
if gotCount != 1 {
|
||||
t.Errorf("Import count: got=%d, want=1", gotCount)
|
||||
}
|
||||
if gotErr != nil {
|
||||
t.Errorf("importPlugin() failed: %v", gotErr)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user