@@ -21,6 +21,7 @@ func TestMap(t *testing.T) {
21
21
t .Parallel ()
22
22
23
23
test := func (t * testing.T , m slog.Map , exp string ) {
24
+ t .Helper ()
24
25
exp = indentJSON (t , exp )
25
26
act := marshalJSON (t , m )
26
27
assert .Equal (t , exp , act , "JSON" )
@@ -61,12 +62,12 @@ func TestMap(t *testing.T) {
61
62
{
62
63
"msg": "wrap1",
63
64
"fun": "cdr.dev/slog_test.TestMap.func2",
64
- "loc": "` + mapTestFile + `:40 "
65
+ "loc": "` + mapTestFile + `:41 "
65
66
},
66
67
{
67
68
"msg": "wrap2",
68
69
"fun": "cdr.dev/slog_test.TestMap.func2",
69
- "loc": "` + mapTestFile + `:41 "
70
+ "loc": "` + mapTestFile + `:42 "
70
71
},
71
72
"EOF"
72
73
],
@@ -82,7 +83,7 @@ func TestMap(t *testing.T) {
82
83
t .Run ("badJSON" , func (t * testing.T ) {
83
84
t .Parallel ()
84
85
85
- mapTestFile = strings .Replace (mapTestFile , "_test" , "" , 1 )
86
+ mapTestFile : = strings .Replace (mapTestFile , "_test" , "" , 1 )
86
87
87
88
test (t , slog .M (
88
89
slog .F ("meow" , indentJSON ),
@@ -92,7 +93,7 @@ func TestMap(t *testing.T) {
92
93
{
93
94
"msg": "failed to marshal to JSON",
94
95
"fun": "cdr.dev/slog.encode",
95
- "loc": "` + mapTestFile + `:84 "
96
+ "loc": "` + mapTestFile + `:88 "
96
97
},
97
98
"json: unsupported type: func(*testing.T, string) string"
98
99
],
0 commit comments