From ce6d2fbb613843afe9068f9f3738f2dc47adbe76 Mon Sep 17 00:00:00 2001 From: lonerover Date: Sun, 12 Mar 2017 11:31:50 +0800 Subject: vim-patch:ac80999 add missing test file https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08 --- src/nvim/testdir/test_glob2regpat.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/nvim/testdir/test_glob2regpat.vim (limited to 'src') diff --git a/src/nvim/testdir/test_glob2regpat.vim b/src/nvim/testdir/test_glob2regpat.vim new file mode 100644 index 0000000000..250ab2746c --- /dev/null +++ b/src/nvim/testdir/test_glob2regpat.vim @@ -0,0 +1,10 @@ +" Test glob2regpat() + +func Test_invalid() + call assert_fails('call glob2regpat(1.33)', 'E806:') +endfunc + +func Test_valid() + call assert_equal('^foo\.', glob2regpat('foo.*')) + call assert_equal('\.vim$', glob2regpat('*.vim')) +endfunc -- cgit From 9f13983de280c53971a8997ead0d6e9d4e3d3e42 Mon Sep 17 00:00:00 2001 From: lonerover Date: Sun, 12 Mar 2017 11:35:30 +0800 Subject: vim-patch:7.4.2185 Problem: Test glob2regpat does not test much. Solution: Add a few more test cases. (Dominique Pelle) https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537 --- src/nvim/testdir/test_glob2regpat.vim | 12 ++++++++++++ src/nvim/version.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_glob2regpat.vim b/src/nvim/testdir/test_glob2regpat.vim index 250ab2746c..52d8a33279 100644 --- a/src/nvim/testdir/test_glob2regpat.vim +++ b/src/nvim/testdir/test_glob2regpat.vim @@ -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 diff --git a/src/nvim/version.c b/src/nvim/version.c index c4d31c4abe..37a91a3933 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -255,7 +255,7 @@ static int included_patches[] = { 2188, // 2187, // 2186 NA - // 2185, + 2185, // 2184, 2183, // 2182 NA -- cgit From a4b57c2089643545d6dca460b9f7c52ba850adc6 Mon Sep 17 00:00:00 2001 From: lonerover Date: Sun, 12 Mar 2017 11:36:34 +0800 Subject: vim-patch:7.4.2187 Problem: glob2regpat test fails on Windows. Solution: Remove the checks that use backslashes. https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b --- src/nvim/testdir/test_glob2regpat.vim | 12 ++++++++---- src/nvim/version.c | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_glob2regpat.vim b/src/nvim/testdir/test_glob2regpat.vim index 52d8a33279..16d7224256 100644 --- a/src/nvim/testdir/test_glob2regpat.vim +++ b/src/nvim/testdir/test_glob2regpat.vim @@ -9,14 +9,18 @@ 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('**')) + + if has('unix') + 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 diff --git a/src/nvim/version.c b/src/nvim/version.c index 37a91a3933..5851fb7779 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -253,7 +253,7 @@ static int included_patches[] = { // 2190, // 2189, 2188, - // 2187, + 2187, // 2186 NA 2185, // 2184, -- cgit From 013a9f9a04d17a7000089c1e6560bff340ff47f2 Mon Sep 17 00:00:00 2001 From: lonerover Date: Sun, 12 Mar 2017 11:39:09 +0800 Subject: vim-patch:7.4.2196 Problem: glob2regpat test doesn't test everything on MS-Windows. Solution: Add patterns with backslash handling. https://github.com/vim/vim/commit/91c5262b19fd2e558fe87b78c7767c7c5a270be8 --- src/nvim/testdir/test_glob2regpat.vim | 8 ++++++-- src/nvim/version.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_glob2regpat.vim b/src/nvim/testdir/test_glob2regpat.vim index 16d7224256..fdf17946b6 100644 --- a/src/nvim/testdir/test_glob2regpat.vim +++ b/src/nvim/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 diff --git a/src/nvim/version.c b/src/nvim/version.c index 5851fb7779..cc1483cc70 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -244,7 +244,7 @@ static int included_patches[] = { // 2199 NA // 2198 NA 2197, - // 2196, + 2196, // 2195 NA 2194, // 2193 NA -- cgit