Documentation ¶
Index ¶
- Variables
- func ExecCases(t httptest.TestingT, code string) (err error)
- type Case
- type Cases
- type Context
- func (p *Context) Cmd_auth(ctx *httptest.Context, args *authArgs)
- func (p *Context) Cmd_binary(ctx *httptest.Context, args *body1Args)
- func (p *Context) Cmd_body(ctx *httptest.Context, args *bodyArgs)
- func (p *Context) Cmd_bson(ctx *httptest.Context, args *body1Args)
- func (p *Context) Cmd_clear(ctx *httptest.Context, args *clearArgs)
- func (p *Context) Cmd_delete(ctx *httptest.Context, args *req1Args)
- func (p *Context) Cmd_echo(ctx *httptest.Context, args *printlnArgs)
- func (p *Context) Cmd_equal(ctx *httptest.Context, args *equalArgs)
- func (p *Context) Cmd_equalSet(ctx *httptest.Context, args *equalArgs)
- func (p *Context) Cmd_form(ctx *httptest.Context, args *body1Args)
- func (p *Context) Cmd_get(ctx *httptest.Context, args *req1Args)
- func (p *Context) Cmd_header(ctx *httptest.Context, args *headerArgs)
- func (p *Context) Cmd_host(ctx *httptest.Context, args *hostArgs)
- func (p *Context) Cmd_json(ctx *httptest.Context, args *body1Args)
- func (p *Context) Cmd_let(ctx *httptest.Context, args *letArgs)
- func (p *Context) Cmd_match(ctx *httptest.Context, args *matchArgs)
- func (p *Context) Cmd_post(ctx *httptest.Context, args *req1Args)
- func (p *Context) Cmd_println(ctx *httptest.Context, args *printlnArgs)
- func (p *Context) Cmd_put(ctx *httptest.Context, args *req1Args)
- func (p *Context) Cmd_req(ctx *httptest.Context, args *reqArgs)
- func (p *Context) Cmd_ret(ctx *httptest.Context, args *retArgs)
- func (p *Context) Exec(ctx *httptest.Context, code string)
- func (p *Context) GetRawCmd() string
- type IContext
- type IExternalContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpected = errors.New("unexpected") ErrSyntaxError_Case = errors.New("syntax error: please use `case <testCaseName>`") ErrSyntaxError_TearDown = errors.New("syntax error: please use `tearDown`") )
View Source
var (
ErrSubCmdNotFound = errors.New("sub command not found")
)
Functions ¶
Types ¶
type Case ¶
一般测试案例框架都有选择性执行某个案例、多个案例共享 setUp、tearDown 这样的启动和终止代码。我们也可以考虑支持。设想如下:
#代码片段1 ... case testCase1 #代码片段2 ... case testCase2 #代码片段3 ... tearDown #代码片段4 ...
这段代码里面,“代码片段1” 将被认为是 setUp 代码,“代码片段4” 是 tearDown 代码,所有 testCase 开始前都会执行一遍“代码片段1”,退出前执行一遍“代码片段4”。每个 case 不用写 end 语句,遇到下一个 case 或者遇到 tearDown 就代表该 case 结束。
type Cases ¶
func ParseCases ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) Cmd_binary ¶
func (*Context) Cmd_delete ¶
func (*Context) Cmd_equalSet ¶
func (*Context) Cmd_header ¶
func (*Context) Cmd_println ¶
type IExternalContext ¶
var ( External IExternalContext ExternalSub IExternalContext )
Click to show internal directories.
Click to hide internal directories.