Files
summercms/backpack/app_test.go
Jakub Zych 96a8d38be2 feat(01-01): boot hello app and dispatch greeter:hello
- Add party plugin registry with Register-before-Boot activation
- Add backpack, compass, bonfire, and pact capability interfaces
- Add examples/hello with two compiled plugin modules
2026-09-16 12:57:18 +02:00

38 lines
747 B
Go

package backpack
import (
"go/parser"
"go/token"
"os"
"strconv"
"strings"
"testing"
)
func TestDoesNotImportParty(t *testing.T) {
entries, err := os.ReadDir(".")
if err != nil {
t.Fatal(err)
}
fset := token.NewFileSet()
for _, entry := range entries {
name := entry.Name()
if entry.IsDir() || !strings.HasSuffix(name, ".go") || strings.HasSuffix(name, "_test.go") {
continue
}
file, err := parser.ParseFile(fset, name, nil, parser.ImportsOnly)
if err != nil {
t.Fatal(err)
}
for _, spec := range file.Imports {
path, err := strconv.Unquote(spec.Path.Value)
if err != nil {
t.Fatal(err)
}
if path == "git.golem15.com/golem15/summercms/party" {
t.Fatalf("%s imports party", name)
}
}
}
}