Documentation
¶
Overview ¶
Package testing provides shared test utilities for output plugins.
Index ¶
- func CreateTestPalette(themeType colour.ThemeType) *colour.CategorisedPalette
- func RunAllTests(t *testing.T, p output.Plugin, config TestConfig)
- func TestBasicInterface(t *testing.T, p output.Plugin, expectedName, expectedDirSubstring string)
- func TestEmbeddedTemplates(t *testing.T, _ any, _ []string)
- func TestFlags(t *testing.T, p output.Plugin, expectedFlagPrefix string)
- func TestGeneration(t *testing.T, p output.Plugin, expectedFiles []string)
- func TestPreExecuteHook(t *testing.T, p any, _ string)
- func TestVerbosePlugin(t *testing.T, p any)
- type TestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestPalette ¶
func CreateTestPalette(themeType colour.ThemeType) *colour.CategorisedPalette
CreateTestPalette creates a test palette with standard colors for testing.
func RunAllTests ¶
func RunAllTests(t *testing.T, p output.Plugin, config TestConfig)
RunAllTests runs all standard tests for a plugin.
func TestBasicInterface ¶
TestBasicInterface tests the basic plugin interface methods that all plugins must implement.
func TestEmbeddedTemplates ¶
TestEmbeddedTemplates tests that embedded templates are accessible.
func TestGeneration ¶
TestGeneration tests the Generate method with various scenarios.
func TestPreExecuteHook ¶
TestPreExecuteHook tests the PreExecute hook if the plugin implements it.
func TestVerbosePlugin ¶
TestVerbosePlugin tests verbose functionality if the plugin supports it.
Types ¶
type TestConfig ¶
type TestConfig struct {
ExpectedName string // Plugin name
ExpectedFiles []string // Files that Generate() should return
ExpectedBinaryName string // Binary name to check in PreExecute (e.g., "fuzzel", "dunst")
ExpectedDirSubstring string // Optional: substring to check in DefaultOutputDir (defaults to ExpectedName if empty)
}
TestConfig holds configuration for running plugin tests.
Click to show internal directories.
Click to hide internal directories.