Documentation
¶
Overview ¶
Package testutil provides shared testscript commands used by the example end-to-end test suites.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commands ¶
func Commands() map[string]func(testScript *testscript.TestScript, neg bool, args []string)
Commands returns the shared custom testscript commands registered by the example test suites.
exit-status <code> <program> [args...] Runs program and asserts the exact process exit code, leaving the command's stdout and stderr available for subsequent assertions. Use this to verify CONGA's exit-code contract: 2 for input/usage errors and 1 for runtime failures. copy-fixture <source> <destination> Copies source (a path relative to the example package directory) into destination (a path relative to the testscript working directory). Use this to materialise fixture files without duplicating them as inline heredocs in every script.
func Main ¶ added in v0.4.0
Main runs the example suite's test binary with COLUMNS cleared, so help screens render at the engine default width regardless of the invoking shell: an exported COLUMNS would otherwise wrap every fixture at the developer's terminal width. Scripts inherit the test process environment, so clearing it here covers every example that calls testscript.Run.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.