go: cuelang.org/go/internal/cuetest Index | Files

package cuetest

import "cuelang.org/go/internal/cuetest"


Package Files

chunker.go sim.go

func Run Uses

func Run(t *testing.T, dir, command string, cfg *Config)

Run executes the given command in the given directory and reports any errors comparing it to the gold standard.

func SplitArgs Uses

func SplitArgs(t *testing.T, s string) (args []string)

type Chunker Uses

type Chunker struct {
    // contains filtered or unexported fields

A Chunker is used to find segments in text.

func NewChunker Uses

func NewChunker(t *testing.T, b []byte) *Chunker

NewChunker returns a new chunker.

func (*Chunker) Bytes Uses

func (c *Chunker) Bytes() []byte

Bytes returns the segment captured by the last call to Next or Find.

func (*Chunker) Find Uses

func (c *Chunker) Find(key string) bool

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 Uses

func (c *Chunker) Next(beg, end string) bool

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 Uses

func (c *Chunker) Text() string

Text returns the text segment captured by the last call to Next or Find.

type Config Uses

type Config struct {
    Stdin  io.Reader
    Stdout io.Writer
    Golden string

Package cuetest imports 10 packages (graph). Updated 2021-01-26. Refresh now. Tools for package owners.