From 19098e93fc44928eb36151540f2183b73efa359e Mon Sep 17 00:00:00 2001 From: Tim Scheuermann Date: Fri, 3 Jun 2022 15:39:03 +0200 Subject: [PATCH] [MM-42878] Allow + in the timestamp for mlog tests (#20360) --- shared/mlog/global_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/mlog/global_test.go b/shared/mlog/global_test.go index b5a362f1f3..3fae371f76 100644 --- a/shared/mlog/global_test.go +++ b/shared/mlog/global_test.go @@ -128,12 +128,12 @@ func TestLoggingAfterInitialized(t *testing.T) { actual := strings.TrimSpace(string(logs)) if testCase.cfg.Format == "json" { - reTs := regexp.MustCompile(`"timestamp":"[0-9\.\-\:\sZ]+"`) + reTs := regexp.MustCompile(`"timestamp":"[0-9\.\-\+\:\sZ]+"`) reCaller := regexp.MustCompile(`"caller":"([^"]+):[0-9\.]+"`) actual = reTs.ReplaceAllString(actual, `"timestamp":0`) actual = reCaller.ReplaceAllString(actual, `"caller":"$1:0"`) } else { - reTs := regexp.MustCompile(`\[\d\d\d\d-\d\d-\d\d\s[0-9\:\.\s\-Z]+\]`) + reTs := regexp.MustCompile(`\[\d\d\d\d-\d\d-\d\d\s[0-9\:\.\s\-\+Z]+\]`) reCaller := regexp.MustCompile(`caller="([^"]+):[0-9\.]+"`) actual = reTs.ReplaceAllString(actual, "TIME") actual = reCaller.ReplaceAllString(actual, `caller="$1:0"`)