comparison 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
comparison
equal deleted inserted replaced
10169:fbb82155b1e2 10170:4acacf4081ce
51 call assert_equal('-aa ab - -ab - -x-', substitute('aa ab x', '\(\(a[a-d] \)*\)\(x\)', '-\1- -\2- -\3-', '')) 51 call assert_equal('-aa ab - -ab - -x-', substitute('aa ab x', '\(\(a[a-d] \)*\)\(x\)', '-\1- -\2- -\3-', ''))
52 endfor 52 endfor
53 bwipe! 53 bwipe!
54 set re=0 54 set re=0
55 endfunc 55 endfunc
56
57 func Test_eow_with_optional()
58 let expected = ['abc def', 'abc', 'def', '', '', '', '', '', '', '']
59 for re in range(0, 2)
60 exe 'set re=' . re
61 let actual = matchlist('abc def', '\(abc\>\)\?\s*\(def\)')
62 call assert_equal(expected, actual)
63 endfor
64 endfunc