cuetest

package
v0.0.0-...-d32bb3a Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testing is a helper package for test packages in the CUE project. As such it should only be imported in _test.go files.

Index

Constants

This section is empty.

Variables

View Source
var FormatTxtar = os.Getenv(envFormatTxtar) != ""

FormatTxtar ensures that .cue files in txtar test archives are well formatted, updating the archive as required prior to running a test.

View Source
var Long = os.Getenv(envLong) != ""

Long determines whether long tests should be run. It is controlled by setting CUE_LONG to a non-empty string like "true". Note that it is not the equivalent of not supplying -short.

View Source
var UpdateGoldenFiles = os.Getenv(envUpdate) != ""

UpdateGoldenFiles determines whether testscript scripts should update txtar archives in the event of cmp failures. It is controlled by setting CUE_UPDATE to a non-empty string like "true". It corresponds to testscript.Params.UpdateGoldenFiles; see its docs for details.

Functions

func Condition

func Condition(cond string) (bool, error)

Condition adds support for CUE-specific testscript conditions within testscript scripts. Supported conditions include:

[long] - evalutates to true when the long build tag is specified

golang.org/issue/N - evaluates to true unless CUE_NON_ISSUES is set to a regexp that matches the condition, i.e. golang.org/issue/N in this case

cuelang.org/issue/N - evaluates to true unless CUE_NON_ISSUES is set to a regexp that matches the condition, i.e. cuelang.org/issue/N in this case

func IssueSkip

func IssueSkip(t *testing.T, s string)

IssueSkip causes the test t to be skipped unless the issue identified by s is deemed to be a non-issue by CUE_NON_ISSUES.

Types

This section is empty.

Jump to

Keyboard shortcuts

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