package cuetest
import "cuelang.org/go/internal/cuetest"
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
- Variables
- func Condition(cond string) (bool, error)
- func IssueSkip(t *testing.T, s string)
- type Chunker
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 ¶
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 ¶
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 ¶
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 ¶
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) Bytes ¶
Bytes returns the segment captured by the last call to Next or Find.
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.
func (*Chunker) Next ¶
Next finds the first occurrence from the current scan position of beg, records the segment from that position until the first occurrence of end and then updates the current position. It reports whether a segment enclosed by beg and end can be found.
func (*Chunker) Text ¶
Text returns the text segment captured by the last call to Next or Find.
Source Files ¶
chunker.go cuetest.go nolong.go
- Version
- v0.4.0
- Published
- May 25, 2021
- Platform
- darwin/amd64
- Imports
- 5 packages
- Last checked
- 36 minutes ago –
Tools for package owners.