forked from aniani/vim
patch 7.4.2185
Problem: Test glob2regpat does not test much. Solution: Add a few more test cases. (Dominique Pelle)
This commit is contained in:
@@ -2,9 +2,21 @@
|
||||
|
||||
func Test_invalid()
|
||||
call assert_fails('call glob2regpat(1.33)', 'E806:')
|
||||
call assert_fails('call glob2regpat("}")', 'E219:')
|
||||
call assert_fails('call glob2regpat("{")', 'E220:')
|
||||
endfunc
|
||||
|
||||
func Test_valid()
|
||||
call assert_equal('^foo\.', glob2regpat('foo.*'))
|
||||
call assert_equal('^foo.$', glob2regpat('foo?'))
|
||||
call assert_equal('^foo?$', glob2regpat('foo\?'))
|
||||
call assert_equal('\.vim$', glob2regpat('*.vim'))
|
||||
call assert_equal('^[abc]$', glob2regpat('[abc]'))
|
||||
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\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
|
||||
call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}'))
|
||||
call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}'))
|
||||
call assert_equal('.*', glob2regpat('**'))
|
||||
endfunc
|
||||
|
@@ -763,6 +763,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2185,
|
||||
/**/
|
||||
2184,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user