Regex: add a unit test for why lookaheads dont count for start chars anymore

This commit is contained in:
Maxime Coste 2017-10-15 10:25:46 +08:00
parent 87eec79d07
commit d44e160aa7

View File

@ -1264,6 +1264,12 @@ auto test_regex = UnitTest{[]{
kak_assert(vm.exec("foo", RegexExecFlags::Search)); kak_assert(vm.exec("foo", RegexExecFlags::Search));
} }
{
TestVM<> vm{R"(.?(?=foo))"};
kak_assert(vm.exec("afoo", RegexExecFlags::Search));
kak_assert(*vm.captures()[0] == 'a');
}
{ {
TestVM<> vm{R"((?i)(?=Foo))"}; TestVM<> vm{R"((?i)(?=Foo))"};
kak_assert(vm.exec("fOO", RegexExecFlags::Search)); kak_assert(vm.exec("fOO", RegexExecFlags::Search));