Unit test edge cases around consecutive \b in patterns Current behavior is if \b consumes the start of a string, consecutive \b is not allowed to consume the end of the string. Should also be unaffected by wildcard. Bug: b/493760346 Change-Id: If743daa0f2ed0a0908e3ee25a7652438fa2603d0 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/21620 Reviewed-by: Takuto Ikuta <tikuta@google.com> Commit-Queue: Richard Wang <richardwa@google.com>
diff --git a/src/gn/pattern_unittest.cc b/src/gn/pattern_unittest.cc index e7f4e4d..7ecede7 100644 --- a/src/gn/pattern_unittest.cc +++ b/src/gn/pattern_unittest.cc
@@ -30,6 +30,7 @@ // Path boundaries. {"\\b", "", true}, {"\\b", "/", true}, + {"\\b\\b", "", false}, {"\\b\\b", "/", true}, {"\\b\\b\\b", "", false}, {"\\b\\b\\b", "/", true}, @@ -50,6 +51,9 @@ {"*a*b*c*d*", "abcd", true}, {"*a*b*c*d*", "1a2b3c4d5", true}, {"*a*b*c*d*", "1a2b3c45", false}, + {"*\\b\\b", "", false}, + {"\\b\\b*", "", false}, + {"*\\b\\b*", "", false}, {"*\\bfoo\\b*", "foo", true}, {"*\\bfoo\\b*", "/foo/", true}, {"*\\bfoo\\b*", "foob", false},