File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ package eventually_test
2+
3+ import (
4+ "fmt"
5+ "testing"
6+ )
7+
8+ type test struct {
9+ * testing.T
10+ logs []string
11+ failed bool
12+ halted bool
13+ }
14+
15+ func (t * test ) Fail () {
16+ t .failed = true
17+ }
18+
19+ func (t * test ) FailNow () {
20+ t .failed = true
21+ t .halted = true
22+ }
23+
24+ func (t * test ) Fatal (args ... interface {}) {
25+ t .Log (args ... )
26+ t .FailNow ()
27+ }
28+
29+ func (t * test ) Fatalf (format string , args ... interface {}) {
30+ t .Logf (format , args ... )
31+ t .FailNow ()
32+ }
33+
34+ func (t * test ) Error (args ... interface {}) {
35+ t .Log (args ... )
36+ t .Fail ()
37+ }
38+
39+ func (t * test ) Errorf (format string , args ... interface {}) {
40+ t .Logf (format , args ... )
41+ t .Fail ()
42+ }
43+
44+ func (t * test ) Log (args ... any ) {
45+ t .logs = append (t .logs , fmt .Sprintln (args ... ))
46+ }
47+
48+ func (t * test ) Logf (format string , args ... any ) {
49+ t .logs = append (t .logs , fmt .Sprintf (format , args ... ))
50+ }
You can’t perform that action at this time.
0 commit comments