aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitchellh/go-testing-interface/testing_go19.go')
-rw-r--r--vendor/github.com/mitchellh/go-testing-interface/testing_go19.go60
1 files changed, 44 insertions, 16 deletions
diff --git a/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go b/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go
index 07fbcb5..31b42ca 100644
--- a/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go
+++ b/vendor/github.com/mitchellh/go-testing-interface/testing_go19.go
@@ -19,14 +19,19 @@ import (
19type T interface { 19type T interface {
20 Error(args ...interface{}) 20 Error(args ...interface{})
21 Errorf(format string, args ...interface{}) 21 Errorf(format string, args ...interface{})
22 Fatal(args ...interface{})
23 Fatalf(format string, args ...interface{})
24 Fail() 22 Fail()
25 FailNow() 23 FailNow()
26 Failed() bool 24 Failed() bool
27 Helper() 25 Fatal(args ...interface{})
26 Fatalf(format string, args ...interface{})
28 Log(args ...interface{}) 27 Log(args ...interface{})
29 Logf(format string, args ...interface{}) 28 Logf(format string, args ...interface{})
29 Name() string
30 Skip(args ...interface{})
31 SkipNow()
32 Skipf(format string, args ...interface{})
33 Skipped() bool
34 Helper()
30} 35}
31 36
32// RuntimeT implements T and can be instantiated and run at runtime to 37// RuntimeT implements T and can be instantiated and run at runtime to
@@ -34,7 +39,8 @@ type T interface {
34// for calls to Fatal. For calls to Error, you'll have to check the errors 39// for calls to Fatal. For calls to Error, you'll have to check the errors
35// list to determine whether to exit yourself. 40// list to determine whether to exit yourself.
36type RuntimeT struct { 41type RuntimeT struct {
37 failed bool 42 skipped bool
43 failed bool
38} 44}
39 45
40func (t *RuntimeT) Error(args ...interface{}) { 46func (t *RuntimeT) Error(args ...interface{}) {
@@ -43,20 +49,10 @@ func (t *RuntimeT) Error(args ...interface{}) {
43} 49}
44 50
45func (t *RuntimeT) Errorf(format string, args ...interface{}) { 51func (t *RuntimeT) Errorf(format string, args ...interface{}) {
46 log.Println(fmt.Sprintf(format, args...)) 52 log.Printf(format, args...)
47 t.Fail() 53 t.Fail()
48} 54}
49 55
50func (t *RuntimeT) Fatal(args ...interface{}) {
51 log.Println(fmt.Sprintln(args...))
52 t.FailNow()
53}
54
55func (t *RuntimeT) Fatalf(format string, args ...interface{}) {
56 log.Println(fmt.Sprintf(format, args...))
57 t.FailNow()
58}
59
60func (t *RuntimeT) Fail() { 56func (t *RuntimeT) Fail() {
61 t.failed = true 57 t.failed = true
62} 58}
@@ -69,7 +65,15 @@ func (t *RuntimeT) Failed() bool {
69 return t.failed 65 return t.failed
70} 66}
71 67
72func (t *RuntimeT) Helper() {} 68func (t *RuntimeT) Fatal(args ...interface{}) {
69 log.Print(args...)
70 t.FailNow()
71}
72
73func (t *RuntimeT) Fatalf(format string, args ...interface{}) {
74 log.Printf(format, args...)
75 t.FailNow()
76}
73 77
74func (t *RuntimeT) Log(args ...interface{}) { 78func (t *RuntimeT) Log(args ...interface{}) {
75 log.Println(fmt.Sprintln(args...)) 79 log.Println(fmt.Sprintln(args...))
@@ -78,3 +82,27 @@ func (t *RuntimeT) Log(args ...interface{}) {
78func (t *RuntimeT) Logf(format string, args ...interface{}) { 82func (t *RuntimeT) Logf(format string, args ...interface{}) {
79 log.Println(fmt.Sprintf(format, args...)) 83 log.Println(fmt.Sprintf(format, args...))
80} 84}
85
86func (t *RuntimeT) Name() string {
87 return ""
88}
89
90func (t *RuntimeT) Skip(args ...interface{}) {
91 log.Print(args...)
92 t.SkipNow()
93}
94
95func (t *RuntimeT) SkipNow() {
96 t.skipped = true
97}
98
99func (t *RuntimeT) Skipf(format string, args ...interface{}) {
100 log.Printf(format, args...)
101 t.SkipNow()
102}
103
104func (t *RuntimeT) Skipped() bool {
105 return t.skipped
106}
107
108func (t *RuntimeT) Helper() {}