-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct_test.go
48 lines (45 loc) · 862 Bytes
/
struct_test.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
37
38
39
40
41
42
43
44
45
46
47
48
package pretty_test
import (
. "github.com/pierrre/pretty"
)
func init() {
addTestCasesPrefix("Struct", []*testCase{
{
name: "Default",
value: testStruct{
Foo: 123,
Bar: 123.456,
unexported: 123,
},
},
{
name: "Empty",
value: struct{}{},
ignoreBenchmark: true,
},
{
name: "FieldFilterExported",
value: testStruct{
Foo: 123,
Bar: 123.456,
unexported: 123,
},
configure: func(vw *CommonValueWriter) {
vw.Kind.BaseStruct.FieldFilter = ExportedStructFieldFilter
},
},
{
name: "Not",
value: "test",
configure: func(vw *CommonValueWriter) {
vw.ValueWriters = ValueWriters{vw.Kind.BaseStruct.WriteValue}
},
ignoreBenchmark: true,
},
})
}
type testStruct struct {
Foo int
Bar float64
unexported int
}