[MM-42878] Allow + in the timestamp for mlog tests (#20360)

Этот коммит содержится в:
Tim Scheuermann
2022-06-03 15:39:03 +02:00
коммит произвёл GitHub
родитель f836826c1d
Коммит 19098e93fc

Просмотреть файл

@@ -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"`)