testing

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package testing provides shared test utilities for output plugins.

Index

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

func TestBasicInterface(t *testing.T, p output.Plugin, expectedName, expectedDirSubstring string)

TestBasicInterface tests the basic plugin interface methods that all plugins must implement.

func TestEmbeddedTemplates

func TestEmbeddedTemplates(t *testing.T, _ any, _ []string)

TestEmbeddedTemplates tests that embedded templates are accessible.

func TestFlags

func TestFlags(t *testing.T, p output.Plugin, expectedFlagPrefix string)

TestFlags tests plugin-specific flag registration.

func TestGeneration

func TestGeneration(t *testing.T, p output.Plugin, expectedFiles []string)

TestGeneration tests the Generate method with various scenarios.

func TestPreExecuteHook

func TestPreExecuteHook(t *testing.T, p any, _ string)

TestPreExecuteHook tests the PreExecute hook if the plugin implements it.

func TestVerbosePlugin

func TestVerbosePlugin(t *testing.T, p any)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL