cuetest

package
v0.3.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

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

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

Types

type Chunker

type Chunker struct {
	// contains filtered or unexported fields
}

A Chunker is used to find segments in text.

func NewChunker

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

NewChunker returns a new chunker.

func (*Chunker) Bytes

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

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

func (*Chunker) Find

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

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

func (c *Chunker) Text() string

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

type Config

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

Jump to

Keyboard shortcuts

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