mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
fish_tests: test that make_anchored regex helper actually anchors
This commit is contained in:
parent
b225ab42aa
commit
2df8bde5eb
1 changed files with 2 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue