mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
fish_tests: test that make_anchored regex helper actually anchors
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user