vim-patch:7.4.2185

Problem:    Test glob2regpat does not test much.
Solution:   Add a few more test cases. (Dominique Pelle)

71dd9744cf
This commit is contained in:
lonerover 2017-03-12 11:35:30 +08:00
parent ce6d2fbb61
commit 9f13983de2
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -255,7 +255,7 @@ static int included_patches[] = {
2188,
// 2187,
// 2186 NA
// 2185,
2185,
// 2184,
2183,
// 2182 NA