-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointer_test.go
More file actions
72 lines (70 loc) · 1.24 KB
/
pointer_test.go
File metadata and controls
72 lines (70 loc) · 1.24 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package pretty_test
import (
. "github.com/pierrre/pretty"
"github.com/pierrre/pretty/internal/prettytest"
)
func init() {
prettytest.AddCasesPrefix("Pointer", []*prettytest.Case{
{
Name: "Default",
Value: func() *int {
i := 123
return &i
}(),
},
{
Name: "Nil",
Value: (*int)(nil),
IgnoreBenchmark: true,
},
{
Name: "ShowAddr",
Value: func() *int {
i := 123
return &i
}(),
ConfigureWriter: func(vw *CommonWriter) {
vw.Kind.Pointer.ShowAddr = true
},
IgnoreResult: true,
IgnoreBenchmark: true,
},
{
Name: "UnknownType",
Value: func() *any {
i := any(123)
return &i
}(),
IgnoreBenchmark: true,
},
{
Name: "ShowKnownTypes",
Value: func() *int {
i := 123
return &i
}(),
ConfigureWriter: func(vw *CommonWriter) {
vw.Type.ShowKnownTypes = true
},
IgnoreBenchmark: true,
},
{
Name: "SupportDisabled",
Value: func() *int {
i := 123
return &i
}(),
ConfigureWriter: func(vw *CommonWriter) {
vw.Support = nil
},
},
{
Name: "Not",
Value: "test",
ConfigureWriter: func(vw *CommonWriter) {
vw.ValueWriters = ValueWriters{vw.Kind.Pointer}
},
IgnoreBenchmark: true,
},
})
}