Skip to content

Commit 862eec4

Browse files
authored
Fix unit tests (#11)
1 parent 9a90196 commit 862eec4

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

logger_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestLogger_Importantw_dev(t *testing.T) {
119119
c.Info(ctx, "hello!", "foo", 1)
120120
c.Important(ctx, "account created", "foo", 1)
121121

122-
assert.Equal(t, "<stripped>\tINFO\tzapctxd/logger_test.go:121\taccount created\t{\"foo\": 1}\n", w.String())
122+
assert.Equal(t, "<stripped>\tINFO\tzapctxd/logger_test.go:120\taccount created\t{\"foo\": 1}\n", w.String())
123123
}
124124

125125
func TestLogger_ColoredOutput_dev(t *testing.T) {
@@ -138,7 +138,7 @@ func TestLogger_ColoredOutput_dev(t *testing.T) {
138138
c.Info(ctx, "hello!", "foo", 1)
139139
c.Important(ctx, "account created", "foo", 1)
140140

141-
assert.Equal(t, "<stripped>\t\u001B[34mINFO\u001B[0m\tzapctxd/logger_test.go:140\taccount created\t{\"foo\": 1}\n", w.String())
141+
assert.Equal(t, "<stripped>\t\u001B[34mINFO\u001B[0m\tzapctxd/logger_test.go:139\taccount created\t{\"foo\": 1}\n", w.String())
142142
}
143143

144144
func TestNew_atomic_dev(t *testing.T) {
@@ -163,20 +163,20 @@ func TestNew_atomic_dev(t *testing.T) {
163163
c.Important(ctx, "msg", "lvl", lvl, "important", true)
164164
}
165165

166-
assert.Equal(t, `<stripped> ERROR zapctxd/logger_test.go:163 msg {"lvl": "error"}
167-
<stripped> INFO zapctxd/logger_test.go:164 msg {"lvl": "error", "important": true}
168-
<stripped> WARN zapctxd/logger_test.go:162 msg {"lvl": "warn"}
169-
<stripped> ERROR zapctxd/logger_test.go:163 msg {"lvl": "warn"}
170-
<stripped> INFO zapctxd/logger_test.go:164 msg {"lvl": "warn", "important": true}
171-
<stripped> INFO zapctxd/logger_test.go:161 msg {"lvl": "info"}
172-
<stripped> WARN zapctxd/logger_test.go:162 msg {"lvl": "info"}
173-
<stripped> ERROR zapctxd/logger_test.go:163 msg {"lvl": "info"}
174-
<stripped> INFO zapctxd/logger_test.go:164 msg {"lvl": "info", "important": true}
175-
<stripped> DEBUG zapctxd/logger_test.go:160 msg {"lvl": "debug"}
176-
<stripped> INFO zapctxd/logger_test.go:161 msg {"lvl": "debug"}
177-
<stripped> WARN zapctxd/logger_test.go:162 msg {"lvl": "debug"}
178-
<stripped> ERROR zapctxd/logger_test.go:163 msg {"lvl": "debug"}
179-
<stripped> INFO zapctxd/logger_test.go:164 msg {"lvl": "debug", "important": true}
166+
assert.Equal(t, `<stripped> ERROR zapctxd/logger_test.go:162 msg {"lvl": "error"}
167+
<stripped> INFO zapctxd/logger_test.go:163 msg {"lvl": "error", "important": true}
168+
<stripped> WARN zapctxd/logger_test.go:161 msg {"lvl": "warn"}
169+
<stripped> ERROR zapctxd/logger_test.go:162 msg {"lvl": "warn"}
170+
<stripped> INFO zapctxd/logger_test.go:163 msg {"lvl": "warn", "important": true}
171+
<stripped> INFO zapctxd/logger_test.go:160 msg {"lvl": "info"}
172+
<stripped> WARN zapctxd/logger_test.go:161 msg {"lvl": "info"}
173+
<stripped> ERROR zapctxd/logger_test.go:162 msg {"lvl": "info"}
174+
<stripped> INFO zapctxd/logger_test.go:163 msg {"lvl": "info", "important": true}
175+
<stripped> DEBUG zapctxd/logger_test.go:159 msg {"lvl": "debug"}
176+
<stripped> INFO zapctxd/logger_test.go:160 msg {"lvl": "debug"}
177+
<stripped> WARN zapctxd/logger_test.go:161 msg {"lvl": "debug"}
178+
<stripped> ERROR zapctxd/logger_test.go:162 msg {"lvl": "debug"}
179+
<stripped> INFO zapctxd/logger_test.go:163 msg {"lvl": "debug", "important": true}
180180
`, w.String(), w.String())
181181
}
182182

@@ -249,9 +249,9 @@ func TestLogger_SkipCaller(t *testing.T) {
249249

250250
do()
251251

252-
assert.Equal(t, `<stripped> INFO zapctxd/logger_test.go:246 hello {"k": "v"}
253-
<stripped> INFO zapctxd/logger_test.go:251 world {"k": "v"}
254-
<stripped> INFO zapctxd/logger_test.go:248 hello {"k": "v"}
252+
assert.Equal(t, `<stripped> INFO zapctxd/logger_test.go:245 hello {"k": "v"}
253+
<stripped> INFO zapctxd/logger_test.go:250 world {"k": "v"}
254+
<stripped> INFO zapctxd/logger_test.go:247 hello {"k": "v"}
255255
`, w.String())
256256

257257
assert.NotNil(t, zapctxd.New(zapctxd.Config{}).SkipCaller())

0 commit comments

Comments
 (0)