fish_tests: test that make_anchored regex helper actually anchors

This commit is contained in:
Johannes Altmanninger 2022-12-17 17:42:38 +01:00
parent b225ab42aa
commit 2df8bde5eb

View file

@ -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() {