Skip to content

Commit 71dd974

Browse files
committed
patch 7.4.2185
Problem: Test glob2regpat does not test much. Solution: Add a few more test cases. (Dominique Pelle)
1 parent 7a9a5f4 commit 71dd974

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/testdir/test_glob2regpat.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
func Test_invalid()
44
call assert_fails('call glob2regpat(1.33)', 'E806:')
5+
call assert_fails('call glob2regpat("}")', 'E219:')
6+
call assert_fails('call glob2regpat("{")', 'E220:')
57
endfunc
68

79
func Test_valid()
810
call assert_equal('^foo\.', glob2regpat('foo.*'))
11+
call assert_equal('^foo.$', glob2regpat('foo?'))
12+
call assert_equal('^foo?$', glob2regpat('foo\?'))
913
call assert_equal('\.vim$', glob2regpat('*.vim'))
14+
call assert_equal('^[abc]$', glob2regpat('[abc]'))
15+
call assert_equal('^foo bar$', glob2regpat('foo\ bar'))
16+
call assert_equal('^foo,bar$', glob2regpat('foo,bar'))
17+
call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}'))
18+
call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
19+
call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}'))
20+
call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}'))
21+
call assert_equal('.*', glob2regpat('**'))
1022
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2185,
766768
/**/
767769
2184,
768770
/**/

0 commit comments

Comments
 (0)