testutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 6 Imported by: 0

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

func Main(m *testing.M, commands map[string]func())

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.

Jump to

Keyboard shortcuts

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