Documentation
¶
Index ¶
- func Each(t Testable, iteratee interface{}) (count int)
- type G
- func (as G) E(args ...interface{})
- func (as G) Eq(a, b interface{}) (result Result)
- func (as G) Equal(a, b interface{}) (result Result)
- func (as G) Err(args ...interface{}) (result Result)
- func (as G) False(a bool) (result Result)
- func (as G) Gt(a, b interface{}) (result Result)
- func (as G) Gte(a, b interface{}) (result Result)
- func (as G) Has(container, str string) (result Result)
- func (as G) Is(a, b interface{}) (result Result)
- func (as G) Len(list interface{}, l int) (result Result)
- func (as G) Lt(a, b interface{}) (result Result)
- func (as G) Lte(a, b interface{}) (result Result)
- func (as G) Neq(a, b interface{}) (result Result)
- func (as G) Nil(args ...interface{}) (result Result)
- func (as G) NotNil(args ...interface{}) (result Result)
- func (hp G) Open(create bool, path ...string) (f *os.File)
- func (as G) Panic(fn func()) (result Result)
- func (hp G) Read(r io.Reader) []byte
- func (hp G) ReadJSON(r io.Reader) (v interface{})
- func (hp G) ReadString(r io.Reader) string
- func (as G) Regex(pattern, str string) (result Result)
- func (hp G) Req(method, url string, body ...interface{}) *ResHelper
- func (hp G) Serve() *Router
- func (hp G) Srand(l int) string
- func (as G) True(a bool) (result Result)
- func (hp G) Write(obj interface{}, w io.Writer)
- type Only
- type Options
- type ResHelper
- type Result
- type Router
- type Skip
- type Testable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Each ¶ added in v0.0.3
Each runs each exported method Fn on type Ctx as a subtest of t. The iteratee can be a struct Ctx or:
iteratee(t Testable) (ctx Ctx)
Each Fn will be called like:
ctx.Fn()
If iteratee is Ctx, its G and T fields will be set to New(t) and t for each test. Any Fn that has the same name with the embedded one will be ignored.
Types ¶
type G ¶ added in v0.2.0
type G struct { Testable // contains filtered or unexported fields }
G is the helper context
func (G) E ¶ added in v0.2.0
func (as G) E(args ...interface{})
E is a shortcut for Nil(args...).Must()
func (G) Open ¶ added in v0.2.0
Open a file. Override it if create is true. Directories will be auto-created. path will be joined with filepath.Join so that it's cross-platform
func (G) Serve ¶ added in v0.2.0
Serve http on a random port. The server will be auto-closed after the test.
type Options ¶ added in v0.1.0
type Options struct { // Dump a value to human readable string Dump func(interface{}) string // Format keywords in the assertion message. // Such as color it for CLI output. Keyword func(string) string }
Options for Assertion
type Result ¶ added in v0.1.0
type Result struct {
// contains filtered or unexported fields
}
Result helper
Click to show internal directories.
Click to hide internal directories.