vim-patch:7.4.2196

Problem:    glob2regpat test doesn't test everything on MS-Windows.
Solution:   Add patterns with backslash handling.

91c5262b19
This commit is contained in:
lonerover 2017-03-12 11:39:09 +08:00
parent a4b57c2089
commit 013a9f9a04
2 changed files with 7 additions and 3 deletions

View File

@ -16,11 +16,15 @@ func Test_valid()
call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}')) call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}'))
call assert_equal('.*', glob2regpat('**')) call assert_equal('.*', glob2regpat('**'))
if has('unix') if exists('+shellslash')
call assert_equal('^foo[\/].$', glob2regpat('foo\?'))
call assert_equal('^\(foo[\/]\|bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
call assert_equal('^[\/]\(foo\|bar[\/]\)$', glob2regpat('\{foo,bar\}'))
call assert_equal('^[\/][\/]\(foo\|bar[\/][\/]\)$', glob2regpat('\\{foo,bar\\}'))
else
call assert_equal('^foo?$', glob2regpat('foo\?')) call assert_equal('^foo?$', glob2regpat('foo\?'))
call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}')) call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}')) call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}'))
call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}')) call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}'))
" todo: Windows
endif endif
endfunc endfunc

View File

@ -244,7 +244,7 @@ static int included_patches[] = {
// 2199 NA // 2199 NA
// 2198 NA // 2198 NA
2197, 2197,
// 2196, 2196,
// 2195 NA // 2195 NA
2194, 2194,
// 2193 NA // 2193 NA