0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 7.4.2196

Problem:    glob2regpat test doesn't test everything on MS-Windows.
Solution:   Add patterns with backslash handling.
This commit is contained in:
Bram Moolenaar
2016-08-10 23:02:45 +02:00
parent bcc1dcc981
commit 91c5262b19
2 changed files with 8 additions and 2 deletions

View File

@@ -16,11 +16,15 @@ func Test_valid()
call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}'))
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,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}'))
call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}'))
" todo: Windows
endif
endfunc

View File

@@ -763,6 +763,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2196,
/**/
2195,
/**/