-
Notifications
You must be signed in to change notification settings - Fork 11
/
fixture_method_info.go
36 lines (32 loc) · 1.13 KB
/
fixture_method_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gunit
import "strings"
type fixtureMethodInfo struct {
name string
isSetup bool
isTeardown bool
isTest bool
isFocusTest bool
isLongTest bool
isSkippedTest bool
}
func (this *fixtureRunner) newFixtureMethodInfo(name string) fixtureMethodInfo {
var (
isSetup = strings.HasPrefix(name, "Setup")
isTeardown = strings.HasPrefix(name, "Teardown")
isTest = strings.HasPrefix(name, "Test")
isLongTest = strings.HasPrefix(name, "LongTest")
isFocusTest = strings.HasPrefix(name, "FocusTest")
isFocusLongTest = strings.HasPrefix(name, "FocusLongTest")
isSkippedTest = strings.HasPrefix(name, "SkipTest")
isSkippedLongTest = strings.HasPrefix(name, "SkipLongTest")
)
return fixtureMethodInfo{
name: name,
isSetup: isSetup,
isTeardown: isTeardown,
isLongTest: isLongTest || isSkippedLongTest || isFocusLongTest,
isFocusTest: isFocusTest || isFocusLongTest,
isSkippedTest: isSkippedTest || isSkippedLongTest,
isTest: isTest || isLongTest || isSkippedTest || isSkippedLongTest || isFocusTest || isFocusLongTest,
}
}