-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock_test.go
More file actions
50 lines (40 loc) · 780 Bytes
/
mock_test.go
File metadata and controls
50 lines (40 loc) · 780 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package eventually_test
import (
"fmt"
"testing"
)
type test struct {
*testing.T
logs []string
failed bool
halted bool
}
func (t *test) Fail() {
t.failed = true
}
func (t *test) FailNow() {
t.failed = true
t.halted = true
}
func (t *test) Fatal(args ...interface{}) {
t.Log(args...)
t.FailNow()
}
func (t *test) Fatalf(format string, args ...interface{}) {
t.Logf(format, args...)
t.FailNow()
}
func (t *test) Error(args ...interface{}) {
t.Log(args...)
t.Fail()
}
func (t *test) Errorf(format string, args ...interface{}) {
t.Logf(format, args...)
t.Fail()
}
func (t *test) Log(args ...any) {
t.logs = append(t.logs, fmt.Sprintln(args...))
}
func (t *test) Logf(format string, args ...any) {
t.logs = append(t.logs, fmt.Sprintf(format, args...))
}