Permalink
Browse files

patch 7.4.2185

Problem:    Test glob2regpat does not test much.
Solution:   Add a few more test cases. (Dominique Pelle)
  • Loading branch information...
1 parent 7a9a5f4 commit 71dd9744cf3842cd45295010d2e5692da1651537 @brammool brammool committed Aug 8, 2016
Showing with 14 additions and 0 deletions.
  1. +12 −0 src/testdir/test_glob2regpat.vim
  2. +2 −0 src/version.c
@@ -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
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2185,
+/**/
2184,
/**/
2183,

0 comments on commit 71dd974

Please sign in to comment.