diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-10 23:02:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-10 23:02:45 +0200 |
commit | 91c5262b19fd2e558fe87b78c7767c7c5a270be8 (patch) | |
tree | 3b93d653a0b7a5c78ef01ddeef4d26a54541718f /src/testdir/test_glob2regpat.vim | |
parent | bcc1dcc981dfc092587d4fbd1327d82a03426c57 (diff) | |
download | vim-git-91c5262b19fd2e558fe87b78c7767c7c5a270be8.tar.gz |
patch 7.4.2196v7.4.2196
Problem: glob2regpat test doesn't test everything on MS-Windows.
Solution: Add patterns with backslash handling.
Diffstat (limited to 'src/testdir/test_glob2regpat.vim')
-rw-r--r-- | src/testdir/test_glob2regpat.vim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/testdir/test_glob2regpat.vim b/src/testdir/test_glob2regpat.vim index 16d722425..fdf17946b 100644 --- a/src/testdir/test_glob2regpat.vim +++ b/src/testdir/test_glob2regpat.vim @@ -16,11 +16,15 @@ func Test_valid() call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}')) call assert_equal('.*', glob2regpat('**')) - if has('unix') + if exists('+shellslash') + call assert_equal('^foo[\/].$', glob2regpat('foo\?')) + 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\\}')) + else call assert_equal('^foo?$', glob2regpat('foo\?')) 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\\}')) - " todo: Windows endif endfunc |