New function for searching and importing plugin

This commit is contained in:
2024-07-19 15:37:00 +02:00
parent 4e3f5cfbc6
commit 33b3e1fc29
3 changed files with 36 additions and 27 deletions
+10 -3
View File
@@ -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)
}
}