Documentation ¶
Index ¶
- Constants
- Variables
- func Run(t T, suites ...tCatcher)
- func RunWithFormatter(t T, formatter Formatter, suites ...tCatcher)
- type Assertion
- type BDDFormatter
- func (formatter *BDDFormatter) AllowedMethodsPattern() string
- func (formatter *BDDFormatter) PrintErrorLog(logs []*Error)
- func (formatter *BDDFormatter) PrintFinalReport(report *FinalReport)
- func (formatter *BDDFormatter) PrintStatus(testFunc *TestFunc)
- func (formatter *BDDFormatter) PrintSuiteInfo(suite *Suite)
- type Error
- type FinalReport
- type Formatter
- type SilentFormatter
- func (formatter *SilentFormatter) AllowedMethodsPattern() string
- func (formatter *SilentFormatter) PrintErrorLog(errorLog []*Error)
- func (formatter *SilentFormatter) PrintFinalReport(report *FinalReport)
- func (formatter *SilentFormatter) PrintStatus(testFunc *TestFunc)
- func (formatter *SilentFormatter) PrintSuiteInfo(suite *Suite)
- type Suite
- func (s *Suite) Equal(exp, act interface{}, messages ...string) *Assertion
- func (s *Suite) Error(args ...interface{})
- func (s *Suite) Failed() bool
- func (s *Suite) False(value bool, messages ...string) *Assertion
- func (s *Suite) Must(result *Assertion, messages ...string) *Assertion
- func (s *Suite) Nil(value interface{}, messages ...string) *Assertion
- func (s *Suite) Not(result *Assertion, messages ...string) *Assertion
- func (s *Suite) Path(path string, messages ...string) *Assertion
- func (s *Suite) Pending()
- func (s *Suite) True(value bool, messages ...string) *Assertion
- type T
- type TDDFormatter
- func (formatter *TDDFormatter) AllowedMethodsPattern() string
- func (formatter *TDDFormatter) PrintErrorLog(logs []*Error)
- func (formatter *TDDFormatter) PrintFinalReport(report *FinalReport)
- func (formatter *TDDFormatter) PrintStatus(testFunc *TestFunc)
- func (formatter *TDDFormatter) PrintSuiteInfo(suite *Suite)
- type TestFunc
Constants ¶
View Source
const ( STATUS_NO_ASSERTIONS = iota STATUS_PASS STATUS_FAIL STATUS_MUST_FAIL STATUS_PENDING )
Variables ¶
View Source
var (
ErrorLog []*Error
)
Functions ¶
func RunWithFormatter ¶
Run runs the test suites using the given formatter.
Types ¶
type BDDFormatter ¶
type BDDFormatter struct {
Description string
}
BDDFormatter is a formatter à la rspec.
func (*BDDFormatter) AllowedMethodsPattern ¶
func (formatter *BDDFormatter) AllowedMethodsPattern() string
func (*BDDFormatter) PrintErrorLog ¶
func (formatter *BDDFormatter) PrintErrorLog(logs []*Error)
func (*BDDFormatter) PrintFinalReport ¶
func (formatter *BDDFormatter) PrintFinalReport(report *FinalReport)
func (*BDDFormatter) PrintStatus ¶
func (formatter *BDDFormatter) PrintStatus(testFunc *TestFunc)
func (*BDDFormatter) PrintSuiteInfo ¶
func (formatter *BDDFormatter) PrintSuiteInfo(suite *Suite)
type FinalReport ¶
type FinalReport struct {
Passed, Failed, ExpectedFailures, Pending, NoAssertions int
}
func (*FinalReport) Total ¶
func (r *FinalReport) Total() int
type Formatter ¶
type Formatter interface { PrintSuiteInfo(suite *Suite) PrintStatus(testFunc *TestFunc) PrintFinalReport(report *FinalReport) PrintErrorLog(errorLog []*Error) // AllowedMethodPattern returns a regexp for the allowed // method name (e.g. "^Test.*" for the TDDFormatter) AllowedMethodsPattern() string }
Formatter is the interface each formatter should implement.
type SilentFormatter ¶
type SilentFormatter struct {
MethodsPattern string
}
func (*SilentFormatter) AllowedMethodsPattern ¶
func (formatter *SilentFormatter) AllowedMethodsPattern() string
func (*SilentFormatter) PrintErrorLog ¶
func (formatter *SilentFormatter) PrintErrorLog(errorLog []*Error)
func (*SilentFormatter) PrintFinalReport ¶
func (formatter *SilentFormatter) PrintFinalReport(report *FinalReport)
func (*SilentFormatter) PrintStatus ¶
func (formatter *SilentFormatter) PrintStatus(testFunc *TestFunc)
func (*SilentFormatter) PrintSuiteInfo ¶
func (formatter *SilentFormatter) PrintSuiteInfo(suite *Suite)
type Suite ¶
func (*Suite) Error ¶
func (s *Suite) Error(args ...interface{})
Error logs an error and marks the test function as failed.
type TDDFormatter ¶
type TDDFormatter struct{}
TDDFormatter is a very simple TDD-like formatter.
Legend:
* F - Test Failed
* OK - Test Passed
* EF - An Expected Failure occured
* NA - Not Assertions found
* PE - Pending test
func (*TDDFormatter) AllowedMethodsPattern ¶
func (formatter *TDDFormatter) AllowedMethodsPattern() string
func (*TDDFormatter) PrintErrorLog ¶
func (formatter *TDDFormatter) PrintErrorLog(logs []*Error)
func (*TDDFormatter) PrintFinalReport ¶
func (formatter *TDDFormatter) PrintFinalReport(report *FinalReport)
func (*TDDFormatter) PrintStatus ¶
func (formatter *TDDFormatter) PrintStatus(testFunc *TestFunc)
func (*TDDFormatter) PrintSuiteInfo ¶
func (formatter *TDDFormatter) PrintSuiteInfo(suite *Suite)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.