package cuetest
import "cuelang.org/go/internal/cuetest"
Index ¶
- func Run(t *testing.T, dir, command string, cfg *Config)
- func SplitArgs(t *testing.T, s string) (args []string)
- type Chunker
- func NewChunker(t *testing.T, b []byte) *Chunker
- func (c *Chunker) Bytes() []byte
- func (c *Chunker) Find(key string) bool
- func (c *Chunker) Next(beg, end string) bool
- func (c *Chunker) Text() string
- type Config
Functions ¶
func Run ¶
Run executes the given command in the given directory and reports any errors comparing it to the gold standard.
func SplitArgs ¶
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.
type Config ¶
Source Files ¶
chunker.go sim.go
- Version
- v0.0.4-rc1
- Published
- Jul 1, 2019
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 47 minutes ago –
Tools for package owners.