]> granicus.if.org Git - vim/commitdiff
patch 7.4.2185 v7.4.2185
authorBram Moolenaar <Bram@vim.org>
Mon, 8 Aug 2016 20:42:04 +0000 (22:42 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 8 Aug 2016 20:42:04 +0000 (22:42 +0200)
Problem:    Test glob2regpat does not test much.
Solution:   Add a few more test cases. (Dominique Pelle)

src/testdir/test_glob2regpat.vim
src/version.c

index 250ab2746ce8d6d12f021484d50cbb5a3497bde7..52d8a33279c754965c8914abc54e5fb4dc154b28 100644 (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
index bb34f29ed2a50778ccd301d9722ed5ee85950d95..d53935e9049c1b86715af05c899a4cfea08be0cc 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2185,
 /**/
     2184,
 /**/