Mercurial > vim
annotate src/testdir/test_glob2regpat.vim @ 9830:6049c1f01391 v7.4.2190
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 9 22:58:21 2016 +0200
patch 7.4.2190
Problem: When startup test fails it's not easy to find out why.
GUI test fails with Gnome.
Solution: Add the help entry matches to a list an assert that.
Set $HOME for Gnome to create .gnome2 directory.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 09 Aug 2016 23:00:08 +0200 |
parents | 0524e72c9023 |
children | f8396c6e5709 |
rev | line source |
---|---|
7767
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test glob2regpat() |
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_invalid() |
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 call assert_fails('call glob2regpat(1.33)', 'E806:') |
9820
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
5 call assert_fails('call glob2regpat("}")', 'E219:') |
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
6 call assert_fails('call glob2regpat("{")', 'E220:') |
7767
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 endfunc |
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 func Test_valid() |
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_equal('^foo\.', glob2regpat('foo.*')) |
9820
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
11 call assert_equal('^foo.$', glob2regpat('foo?')) |
7767
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal('\.vim$', glob2regpat('*.vim')) |
9820
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
13 call assert_equal('^[abc]$', glob2regpat('[abc]')) |
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
14 call assert_equal('^foo bar$', glob2regpat('foo\ bar')) |
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
15 call assert_equal('^foo,bar$', glob2regpat('foo,bar')) |
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
16 call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}')) |
6882920b42da
commit https://github.com/vim/vim/commit/71dd9744cf3842cd45295010d2e5692da1651537
Christian Brabandt <cb@256bit.org>
parents:
7767
diff
changeset
|
17 call assert_equal('.*', glob2regpat('**')) |
9824
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
18 |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
19 if has('unix') |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
20 call assert_equal('^foo?$', glob2regpat('foo\?')) |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
21 call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}')) |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
22 call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}')) |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
23 call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}')) |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
24 " todo: Windows |
0524e72c9023
commit https://github.com/vim/vim/commit/7547a78446c1a3c04b36c0533f0f046188bd378b
Christian Brabandt <cb@256bit.org>
parents:
9820
diff
changeset
|
25 endif |
7767
c9daa07abf34
commit https://github.com/vim/vim/commit/ac80999985299dae4a9ef56dbf31fbdb35c04c08
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 endfunc |