Documentation ¶
Overview ¶
Package frameworktestutil contains utilities for testing functions written using the framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResultsChecker ¶
type ResultsChecker struct { // TestDataDirectory is the directory containing the testdata subdirectories. // ResultsChecker will recurse into each test directory and run the Command // if the directory contains both the ConfigInputFilename and at least one // of ExpectedOutputFilname or ExpectedErrorFilename. // Defaults to "testdata" TestDataDirectory string // ConfigInputFilename is the name of the config file provided as the first // argument to the function. Directories without this file will be skipped. // Defaults to "config.yaml" ConfigInputFilename string // InputFilenameGlob matches function inputs // Defaults to "input*.yaml" InputFilenameGlob string // ExpectedOutputFilename is the file with the expected output of the function // Defaults to "expected.yaml". Directories containing neither this file // nore ExpectedErrorFilename will be skipped. ExpectedOutputFilename string // ExpectedErrorFilename is the file containing part of an expected error message // Defaults to "error.yaml". Directories containing neither this file // nore ExpectedOutputFilname will be skipped. ExpectedErrorFilename string // Command provides the function to run. Command func() *cobra.Command }
ResultsChecker tests a function by running it with predefined inputs and comparing the outputs to expected results.
Click to show internal directories.
Click to hide internal directories.