0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.0.0623: error for invalid regexp is not very informative

Problem:    The message "Invalid range" is used for multiple errors.
Solution:   Add two more specific error messages. (Itchyny, Ken Hamada)
This commit is contained in:
Bram Moolenaar
2017-06-05 16:54:08 +02:00
parent c5e2b040b4
commit 966e58e413
4 changed files with 25 additions and 4 deletions

View File

@@ -137,3 +137,20 @@ func Test_classes_re2()
call s:classes_test()
set re=0
endfunc
func Test_reversed_range()
for re in range(0, 2)
exe 'set re=' . re
call assert_fails('call match("abc def", "[c-a]")', 'E944:')
endfor
set re=0
endfunc
func Test_large_class()
set re=1
call assert_fails('call match("abc def", "[\u3000-\u4000]")', 'E945:')
set re=2
call assert_equal(0, 'abc def' =~# '[\u3000-\u4000]')
call assert_equal(1, "\u3042" =~# '[\u3000-\u4000]')
set re=0
endfunc