From ec5e3b0f3dcb8c1d342c980c8c8f39bde0d81cdc Mon Sep 17 00:00:00 2001 From: Akshay Shah Date: Tue, 14 Mar 2017 10:21:09 -0700 Subject: [PATCH] Make test for stdlib caller skip more specific --- global_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/global_test.go b/global_test.go index b6407f430..f0304f9d6 100644 --- a/global_test.go +++ b/global_test.go @@ -101,7 +101,12 @@ func TestNewStdLog(t *testing.T) { entry := logs.AllUntimed()[0] assert.Equal(t, []zapcore.Field{}, entry.Context, "Unexpected entry context.") assert.Equal(t, "redirected", entry.Entry.Message, "Unexpected entry message.") - assert.Contains(t, entry.Entry.Caller.File, "global_test.go", "Unexpected caller annotation.") + assert.Regexp( + t, + `go.uber.org/zap/global_test.go:\d+$`, + entry.Entry.Caller.String(), + "Unexpected caller annotation.", + ) }) }