tester

package
v0.0.0-...-73a082e Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MSG = iota
	ERR
	TST
	EXIT
)

Variables

View Source
var (
	StdOut     chan MessageCh
	LineLength = 70
)
View Source
var (
	APIURL  string
	Dump    bool
	Headers map[string]string
)

Functions

func FileList

func FileList(args []string) ([]string, error)

func Message

func Message(format string, a ...interface{})

func MessageError

func MessageError(format string, a ...interface{})

func MessageExit

func MessageExit()

func MessageTest

func MessageTest(format string, a ...interface{})

func PrinterWatch

func PrinterWatch(msg <-chan MessageCh)

func RunNew

func RunNew(options Options, scan Scan) error

Types

type Assert

type Assert struct {
	NotEmpty []string
	Empty    []string
}

type CmdFunc

type CmdFunc func(in interface{}, val string) (interface{}, error)

type Condition

type Condition map[int]*ConditionCmd

type ConditionCmd

type ConditionCmd struct {
	Cmd   CmdFunc
	Value string
}

type Element

type Element struct {
	Body        []byte
	StartLine   int
	StartColumn int
	EndLine     int
	EndColumn   int
}

type MessageCh

type MessageCh struct {
	Type   int
	Format string
	Args   []interface{}
}

type Options

type Options struct {
	URL     string
	Path    []string
	Headers map[string]string
	StdOut  chan MessageCh
	Verbose bool
}

type Scan

type Scan func(in []byte, s *Suite) error

type Suite

type Suite struct {
	Title  Element
	Tests  []Test
	VarSet Vars
}

type Test

type Test struct {
	Title        Element
	Query        Element
	QueryVar     Element
	Response     Element
	ResponseVars Vars
	Assertion    []Assert
	Conditions   []Condition
}

func (*Test) HasExpectedResponseBody

func (t *Test) HasExpectedResponseBody() bool

type Vars

type Vars map[string]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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