diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-15 10:25:46 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-11-01 14:05:15 +0800 |
| commit | d44e160aa7aa2c707e6b2c0cfea7a55dce6df764 (patch) | |
| tree | f50242e05fc327ca93a293d6952d82a63ffb956b /src | |
| parent | 87eec79d07454352a8e063cb825c2817eb0a0db4 (diff) | |
Regex: add a unit test for why lookaheads dont count for start chars anymore
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex_impl.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc index f99fe5e0..e3b73df1 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -1265,6 +1265,12 @@ auto test_regex = UnitTest{[]{ } { + TestVM<> vm{R"(.?(?=foo))"}; + kak_assert(vm.exec("afoo", RegexExecFlags::Search)); + kak_assert(*vm.captures()[0] == 'a'); + } + + { TestVM<> vm{R"((?i)(?=Foo))"}; kak_assert(vm.exec("fOO", RegexExecFlags::Search)); kak_assert(*vm.captures()[0] == 'f'); |
