From 7f1c8d98c5ab5492e1693667e1d6de30b966cd79 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 14 Oct 2021 16:16:48 +0000 Subject: [PATCH] tools: Fix file regex in fix-tests The old regex was not allowing numbers in the filenames. Change-Id: Ic16de247f9caadefda6d6eb05896923ba4399ba5 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66441 Commit-Queue: Ben Clayton Kokoro: Ben Clayton Reviewed-by: David Neto Reviewed-by: Antonio Maiorano --- tools/src/cmd/fix-tests/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/src/cmd/fix-tests/main.go b/tools/src/cmd/fix-tests/main.go index 026556a018..bb2f18d91e 100644 --- a/tools/src/cmd/fix-tests/main.go +++ b/tools/src/cmd/fix-tests/main.go @@ -144,9 +144,9 @@ var ( // Regular expression to match a test declaration reTests = regexp.MustCompile(`TEST(?:_[FP])?\([ \n]*(\w+),[ \n]*(\w+)\)`) // Regular expression to match a `EXPECT_EQ(a, b)` failure for strings - reExpectEq = regexp.MustCompile(`([./\\a-z_-]*):(\d+).*\nExpected equality of these values:\n(?:.|\n)*?(?:Which is: | )"((?:.|\n)*?[^\\])"\n(?:.|\n)*?(?:Which is: | )"((?:.|\n)*?[^\\])"`) + reExpectEq = regexp.MustCompile(`([./\\\w_-]*):(\d+).*\nExpected equality of these values:\n(?:.|\n)*?(?:Which is: | )"((?:.|\n)*?[^\\])"\n(?:.|\n)*?(?:Which is: | )"((?:.|\n)*?[^\\])"`) // Regular expression to match a `EXPECT_THAT(a, HasSubstr(b))` failure for strings - reExpectHasSubstr = regexp.MustCompile(`([./\\a-z_-]*):(\d+).*\nValue of: .*\nExpected: has substring "((?:.|\n)*?[^\\])"\n Actual: "((?:.|\n)*?[^\\])"`) + reExpectHasSubstr = regexp.MustCompile(`([./\\\w_-]*):(\d+).*\nValue of: .*\nExpected: has substring "((?:.|\n)*?[^\\])"\n Actual: "((?:.|\n)*?[^\\])"`) ) func processFailure(test, wd, failure string) error {