From 3847eeb1ac2af8fd85371cade03f32d026d34966 Mon Sep 17 00:00:00 2001 From: John Strunk Date: Tue, 5 Apr 2022 11:45:35 -0400 Subject: [PATCH] fix: zap-time-encoding test should allow negative tz offset The regex used to test whether the times were being properly encoded as ISO8601 only permitted either positive tz offsets or Z. This fix adjusts the regex to also allow negative offsets. Signed-off-by: John Strunk --- pkg/log/zap/zap_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/log/zap/zap_test.go b/pkg/log/zap/zap_test.go index b0b3445a01..2d18476e1f 100644 --- a/pkg/log/zap/zap_test.go +++ b/pkg/log/zap/zap_test.go @@ -528,7 +528,7 @@ var _ = Describe("Zap log level flag options setup", func() { It("Should propagate time encoder to logger", func() { // zaps ISO8601TimeEncoder uses 2006-01-02T15:04:05.000Z0700 as pattern for iso8601 encoding - iso8601Pattern := `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}(\+[0-9]{4}|Z)` + iso8601Pattern := `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}([-+][0-9]{4}|Z)` args := []string{"--zap-time-encoding=iso8601"} fromFlags.BindFlags(&fs)