mapper

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertImplementation

func AssertImplementation(t *testing.T, executeFunc func(*testing.T, []string, *cli.CLI) error)

AssertImplementation provides a comprehensive test suite for CLI mapper implementations. It validates that any mapper correctly handles all aspects of CLI execution including: - CLI name resolution and preservation - Error handling and propagation (including custom exit statuses and help requests) - Flag parsing and inheritance across command hierarchies - Hook execution order (persistent and command-specific hooks) - Command structure navigation and execution - Context propagation through the command chain

The executeFunc parameter should be the mapper's main execution function that takes command line arguments and a CLI instance, then executes the appropriate command. This allows testing any mapper implementation (e.g., spf13/cobra, urfave/cli, etc.) against the same comprehensive test suite.

Types

This section is empty.

Directories

Path Synopsis
spf13

Jump to

Keyboard shortcuts

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