//go:build linux package enforce import ( "context" "os" "testing" "time" ) func TestX11GuardMinimizeActiveDoesNotPanic(t *testing.T) { if os.Getenv("DISPLAY") == "" { t.Skip("no DISPLAY; skipping live X11 minimize smoke test") } ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() // Either it minimizes the active window or returns an error (e.g. no active // window); we only assert it returns without panicking. if err := NewGuard().MinimizeActive(ctx); err != nil { t.Logf("MinimizeActive returned (acceptable): %v", err) } }