Mercurial > vim
view src/testdir/test_glob2regpat.vim @ 21945:9998f4e44a73 v8.2.1522
patch 8.2.1522: not enough test coverage for the spell file handling
Commit: https://github.com/vim/vim/commit/c8ec5fe56fc30201c889ca577bf1e69823fadb2a
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 24 20:28:56 2020 +0200
patch 8.2.1522: not enough test coverage for the spell file handling
Problem: Not enough test coverage for the spell file handling.
Solution: Add spell file tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6763)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 24 Aug 2020 20:30:04 +0200 |
parents | 08940efa6b4e |
children | 5f8dd7b3ae41 |
line wrap: on
line source
" Test glob2regpat() func Test_glob2regpat_invalid() if has('float') call assert_fails('call glob2regpat(1.33)', 'E806:') endif call assert_fails('call glob2regpat("}")', 'E219:') call assert_fails('call glob2regpat("{")', 'E220:') endfunc func Test_glob2regpat_valid() call assert_equal('^foo\.', glob2regpat('foo.*')) call assert_equal('^foo.$', 'foo?'->glob2regpat()) 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('.*', glob2regpat('**')) 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\\}')) endif endfunc " vim: shiftwidth=2 sts=2 expandtab