From 9caea2a4cf25ccfa1a88485e25f39707225f81e7 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 24 Jan 2022 15:03:49 -0500 Subject: [PATCH] fix(tests): Fix RFC3339 regex for log unit tests --- internal/log/helpers_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/log/helpers_test.go b/internal/log/helpers_test.go index 24a6c7fa96..4db8a2bdd3 100644 --- a/internal/log/helpers_test.go +++ b/internal/log/helpers_test.go @@ -4,7 +4,12 @@ package log // RFC3339 format -const timePrefixRegex = `^2[0-9]{3}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]Z ` +const timePrefixRegex = `([0-9]+)-` + + `(0[1-9]|1[012])-` + + `(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3])` + + `:([0-5][0-9])` + + `:([0-5][0-9]|60)(\.[0-9]+)?(([Zz])|([\+|\-]([01][0-9]|2[0-3])` + + `:[0-5][0-9])) ` func levelPtr(l Level) *Level { return &l }