diff src/testdir/test_regexp_latin.vim @ 10170:4acacf4081ce v7.4.2355

commit https://github.com/vim/vim/commit/16b3578f355282846f2600ce77fb344950f0b9ce Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 9 20:29:50 2016 +0200 patch 7.4.2355 Problem: Regexp fails to match when using "\>\)\?". (Ramel) Solution: When a state is already in the list, but addstate_here() is used and the existing state comes later, add the new state anyway.
author Christian Brabandt <cb@256bit.org>
date Fri, 09 Sep 2016 20:30:07 +0200
parents 3c37899baa8d
children 14b6b79d685b
line wrap: on
line diff
--- a/src/testdir/test_regexp_latin.vim
+++ b/src/testdir/test_regexp_latin.vim
@@ -53,3 +53,12 @@ func Test_nested_backrefs()
   bwipe!
   set re=0
 endfunc
+
+func Test_eow_with_optional()
+  let expected = ['abc def', 'abc', 'def', '', '', '', '', '', '', '']
+  for re in range(0, 2)
+    exe 'set re=' . re
+    let actual = matchlist('abc def', '\(abc\>\)\?\s*\(def\)')
+    call assert_equal(expected, actual)
+  endfor
+endfunc