| 1 | package conveyscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/ |
| 2 | |
| 3 | type actionSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/actionSpecifier# uint8 |
| 4 | |
| 5 | const ( |
| 6 | noSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/noSpecifier. actionSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/actionSpecifier# = iota |
| 7 | skipConveyscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/skipConvey. |
| 8 | focusConveyscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/focusConvey. |
| 9 | ) |
| 10 | |
| 11 | type suitescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite# struct { |
| 12 | Situationscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Situation. string |
| 13 | Testscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Test. tscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/t# |
| 14 | Focusscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Focus. bool |
| 15 | Funcscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Func. func(Cscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/C#) // nil means skipped |
| 16 | FailModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#FailMode. FailureModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/FailureMode# |
| 17 | } |
| 18 | |
| 19 | func newSuitescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/newSuite().(situation string, failureMode FailureModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/FailureMode#, f func(Cscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/C#), test tscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/t#, specifier actionSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/actionSpecifier#) *suitescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite# { |
| 20 | ret := &suitescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#{ |
| 21 | Situationscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Situation.: situation, |
| 22 | Testscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Test.: test, |
| 23 | Funcscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Func.: f, |
| 24 | FailModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#FailMode.: failureMode, |
| 25 | } |
| 26 | switch specifier { |
| 27 | case skipConveyscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/skipConvey.: |
| 28 | ret.Funcscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Func. = nil |
| 29 | case focusConveyscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/focusConvey.: |
| 30 | ret.Focusscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite#Focus. = true |
| 31 | } |
| 32 | return ret |
| 33 | } |
| 34 | |
| 35 | func discoverscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/discover().(items []interface{}) *suitescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/suite# { |
| 36 | name, items := parseNamescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseName().(items) |
| 37 | test, items := parseGoTestscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseGoTest().(items) |
| 38 | failure, items := parseFailureModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseFailureMode().(items) |
| 39 | action, items := parseActionscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseAction().(items) |
| 40 | specifier, items := parseSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseSpecifier().(items) |
| 41 | |
| 42 | if len(items) != 0 { |
| 43 | conveyPanicscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/conveyPanic().(parseErrorscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseError.) |
| 44 | } |
| 45 | |
| 46 | return newSuitescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/newSuite().(name, failure, action, test, specifier) |
| 47 | } |
| 48 | func itemscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/item().(items []interface{}) interface{} { |
| 49 | if len(items) == 0 { |
| 50 | conveyPanicscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/conveyPanic().(parseErrorscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseError.) |
| 51 | } |
| 52 | return items[0] |
| 53 | } |
| 54 | func parseNamescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseName().(items []interface{}) (string, []interface{}) { |
| 55 | if name, parsed := itemscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/item().(items).(string); parsed { |
| 56 | return name, items[1:] |
| 57 | } |
| 58 | conveyPanicscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/conveyPanic().(parseErrorscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseError.) |
| 59 | panic("never get here") |
| 60 | } |
| 61 | func parseGoTestscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseGoTest().(items []interface{}) (tscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/t#, []interface{}) { |
| 62 | if test, parsed := itemscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/item().(items).(tscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/t#); parsed { |
| 63 | return test, items[1:] |
| 64 | } |
| 65 | return nil, items |
| 66 | } |
| 67 | func parseFailureModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseFailureMode().(items []interface{}) (FailureModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/FailureMode#, []interface{}) { |
| 68 | if mode, parsed := itemscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/item().(items).(FailureModescip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/FailureMode#); parsed { |
| 69 | return mode, items[1:] |
| 70 | } |
| 71 | return FailureInheritsscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/FailureInherits., items |
| 72 | } |
| 73 | func parseActionscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseAction().(items []interface{}) (func(Cscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/C#), []interface{}) { |
| 74 | switch x := itemscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/item().(items).(type) { |
| 75 | case nil: |
| 76 | return nil, items[1:] |
| 77 | case func(Cscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/C#): |
| 78 | return x, items[1:] |
| 79 | case func(): |
| 80 | return func(Cscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/C#) { x() }, items[1:] |
| 81 | } |
| 82 | conveyPanicscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/conveyPanic().(parseErrorscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseError.) |
| 83 | panic("never get here") |
| 84 | } |
| 85 | func parseSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseSpecifier().(items []interface{}) (actionSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/actionSpecifier#, []interface{}) { |
| 86 | if len(items) == 0 { |
| 87 | return noSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/noSpecifier., items |
| 88 | } |
| 89 | if spec, ok := items[0].(actionSpecifierscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/actionSpecifier#); ok { |
| 90 | return spec, items[1:] |
| 91 | } |
| 92 | conveyPanicscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/conveyPanic().(parseErrorscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseError.) |
| 93 | panic("never get here") |
| 94 | } |
| 95 | |
| 96 | // This interface allows us to pass the *testing.T struct |
| 97 | // throughout the internals of this package without ever |
| 98 | // having to import the "testing" package. |
| 99 | type tscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/t# interface { |
| 100 | Failscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/t#Fail.() |
| 101 | } |
| 102 | |
| 103 | const parseErrorscip-go gomod github.com/smartystreets/goconvey . `github.com/smartystreets/goconvey/convey`/parseError. = "You must provide a name (string), then a *testing.T (if in outermost scope), an optional FailureMode, and then an action (func())." |