-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_test.go
51 lines (49 loc) · 936 Bytes
/
string_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
49
50
51
package pretty_test
import (
. "github.com/pierrre/pretty"
)
func init() {
addTestCasesPrefix("String", []*testCase{
{
name: "Default",
value: "test",
},
{
name: "Empty",
value: "",
ignoreBenchmark: true,
},
{
name: "ShowAddr",
value: "test",
configure: func(vw *CommonValueWriter) {
vw.Kind.BaseString.ShowAddr = true
},
ignoreResult: true,
ignoreBenchmark: true,
},
{
name: "Unquoted",
value: "aaa\nbbb",
configure: func(vw *CommonValueWriter) {
vw.Kind.BaseString.Quote = false
},
},
{
name: "Truncated",
value: "test",
configure: func(vw *CommonValueWriter) {
vw.Kind.BaseString.MaxLen = 2
},
ignoreBenchmark: true,
},
{
name: "Not",
value: 123,
configure: func(vw *CommonValueWriter) {
vw.ValueWriters = ValueWriters{vw.Kind.BaseString.WriteValue}
},
ignoreBenchmark: true,
},
})
}