script

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape added in v0.0.7

func Escape(s string) string

func ParseCommand

func ParseCommand(s string) (env []string, args []string)

func ParseInput

func ParseInput(s string) (env []string, input string)

func Unescape

func Unescape(s string) string

Types

type Case

type Case struct {
	Path   string
	Parts  []part
	WasRun bool
}

func ParseCases

func ParseCases(s string) *Case

func (*Case) Open

func (c *Case) Open(name string) (fs.File, error)

func (*Case) ToActual

func (c *Case) ToActual() string

type CaseReadline

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

type CaseRun

type CaseRun struct {
	LineNr  int
	Case    *Case
	Command string
	Env     []string

	StdinInitial     string
	ExpectedStdout   string
	ExpectedStderr   string
	ExpectedExitCode int
	ActualStdoutBuf  *bytes.Buffer
	ActualStderrBuf  *bytes.Buffer
	ActualExitCode   int
	Readlines        []CaseReadline
	ReadlinesPos     int
	ReadlineEnv      []string
	WasRun           bool
	// contains filtered or unexported fields
}

func (*CaseRun) Args

func (cr *CaseRun) Args() []string

func (*CaseRun) ConfigDir

func (cr *CaseRun) ConfigDir() (string, error)

func (*CaseRun) Environ

func (cr *CaseRun) Environ() []string

func (*CaseRun) FS

func (cr *CaseRun) FS() fs.FS

func (*CaseRun) History

func (cr *CaseRun) History() ([]string, error)

func (*CaseRun) InterruptChan

func (cr *CaseRun) InterruptChan() chan struct{}

func (*CaseRun) Line

func (cr *CaseRun) Line() int

func (*CaseRun) Platform added in v0.0.5

func (cr *CaseRun) Platform() interp.Platform

func (*CaseRun) Readline

func (cr *CaseRun) Readline(opts interp.ReadlineOpts) (string, error)

func (*CaseRun) Stderr

func (cr *CaseRun) Stderr() interp.Output

func (*CaseRun) Stdin

func (cr *CaseRun) Stdin() interp.Input

func (*CaseRun) Stdout

func (cr *CaseRun) Stdout() interp.Output

func (*CaseRun) ToExpectedStderr

func (cr *CaseRun) ToExpectedStderr() string

func (*CaseRun) ToExpectedStdout

func (cr *CaseRun) ToExpectedStdout() string

type CaseRunInput

type CaseRunInput struct {
	interp.FileReader
	// contains filtered or unexported fields
}

func (CaseRunInput) IsTerminal

func (i CaseRunInput) IsTerminal() bool

func (CaseRunInput) Size

func (i CaseRunInput) Size() (int, int)

type CaseRunOutput

type CaseRunOutput struct {
	io.Writer
	Terminal bool
	Width    int
	Height   int
}

func (CaseRunOutput) IsTerminal

func (o CaseRunOutput) IsTerminal() bool

func (CaseRunOutput) Size

func (o CaseRunOutput) Size() (int, int)

type Section

type Section struct {
	LineNr int
	Name   string
	Value  string
	// contains filtered or unexported fields
}

func SectionParser

func SectionParser(re *regexp.Regexp, s string) []Section

Jump to

Keyboard shortcuts

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