test

package
v0.34.0-test1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trim

func Trim(s string) string

Types

type Exec

type Exec struct {
	Name     string
	Command  string
	Input    string
	Expected string
}

func (*Exec) Run

func (e *Exec) Run(path string) (string, error)

type File

type File struct {
	Name string
	Data string
}

type Internal

type Internal struct {
	Name         string
	Query        string
	Input        string
	InputFormat  string // defaults to "auto", like zq
	OutputFormat string // defaults to "zson", like zq
	Expected     string
	ExpectedErr  error
}

func (*Internal) Run

func (i *Internal) Run() (string, error)

type Shell

type Shell struct {
	Name             string
	Script           string
	Input            []File
	Expected         []File
	ExpectedStderrRE string
}

type ShellTest

type ShellTest struct {
	Shell
	// contains filtered or unexported fields
}

func NewShellTest

func NewShellTest(s Shell) *ShellTest

func (*ShellTest) Cleanup

func (s *ShellTest) Cleanup()

func (*ShellTest) Read

func (s *ShellTest) Read(name string) (string, error)

func (*ShellTest) Run

func (s *ShellTest) Run(root, pwd string) (string, string, error)

func (*ShellTest) Setup

func (s *ShellTest) Setup(dir, pwd string) error

Setup creates a temp directory in the dir path provided.

Jump to

Keyboard shortcuts

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