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 ¶
const Long = false
LongTest is a build tag used to indicate that long tests should be run. Note this is not the equivalent of not supplying -short.
Variables ¶
var UpdateGoldenFiles = os.Getenv(envUpdate) != ""
UpdateGoldenFiles determines whether testscript scripts should update txtar archives in the event of cmp failures. It corresponds to testscript.Params.UpdateGoldenFiles. See the docs for testscript.Params.UpdateGoldenFiles for more details.
Functions ¶
func Condition ¶ added in v0.3.0
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
Types ¶
type Chunker ¶
type Chunker struct {
// contains filtered or unexported fields
}
A Chunker is used to find segments in text.
func NewChunker ¶
NewChunker returns a new chunker.
func (*Chunker) Find ¶
Find searches for key from the current position and sets the current segment to the text from current position up till the key's position. If successful, the position is updated to point directly after the occurrence of key.