Documentation ¶
Overview ¶
Package genparams provides utilities to generate large Tast test metadata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure ensures that parameterized test parameters in a test metadata are up-to-date.
file is a file name of a .go file containing a Tast test definition (i.e. testing.AddTest call). params is a Go literal expression as a string that represents test parameters.
If TAST_GENERATE_UPDATE environment variable is not set, this function checks if parameterized test parameters in file matches with params. If any mismatch is found, it reports a test error with a message prompting users to regenerate parameterized test parameters.
If TAST_GENERATE_UPDATE environment variable is set, this function rewrites the testing.Test literal in file with params.
func Template ¶
Template is a utility function to render a Go template into a string in a single call.
Go's standard template engine is used to render a template string. See https://godoc.org/text/template for the template syntax.
This function also installs a few helper function that can be called inside templates:
fmt(v interface{}) string - Formats v in a Go syntax. Supported types are boolean, integer, float, string, slice of supported types, map of supported types.
Types ¶
type TestingT ¶
type TestingT interface { Helper() Logf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) }
TestingT is a subset of testing.T. Exported functions in this package take TestingT instead of testing.T to allow unit-testing.