diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 08c6eaa3c..2e854832e 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -6906,6 +6906,7 @@ static void test_re_basic() { do_test(!re->match(L"")); do_test(!re->match(L"ab")); do_test((re->match(L"abcd") == match_range_t{0, 4})); + do_test(!re->match(L"xabcd")); do_test((re->match(L"abcdefghij") == match_range_t{0, 10})); re = regex_t::try_compile(make_anchored(L"(a+)|(b+)")); @@ -6914,6 +6915,7 @@ static void test_re_basic() { do_test(!re->match(L"aabb")); do_test((re->match(L"aaaa") == match_range_t{0, 4})); do_test((re->match(L"bbbb") == match_range_t{0, 4})); + do_test(!re->match(L"aaaax")); } static void test_re_reset() {