package diary_test import ( "os/exec" "strings" "testing" ) // TestDiaryDoesNotLinkTheConsoleStack (IN-07): diary, and the security // modules that log through it, link neither bonfire nor the TUI stack // (bubbletea, bubbles, huh) nor cobra. The console types diary shares with // bonfire live in internal/consolekit. func TestDiaryDoesNotLinkTheConsoleStack(t *testing.T) { goTool, err := exec.LookPath("go") if err != nil { t.Skip("go tool not on PATH") } const module = "git.golem15.com/golem15/summercms/modules/" out, err := exec.Command(goTool, "list", "-deps", module+"diary", module+"bouncer", module+"wristband").Output() if err != nil { t.Fatalf("go list -deps: %v", err) } banned := []string{module + "bonfire", "charm.land/bubbletea/v2", "charm.land/bubbles/v2", "charm.land/huh/v2", "github.com/spf13/cobra"} for _, dep := range strings.Split(string(out), "\n") { for _, b := range banned { if dep == b || strings.HasPrefix(dep, b+"/") { t.Errorf("diary, bouncer or wristband links %s", dep) } } } }