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:
@@ -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
|
||||
|
Reference in New Issue
Block a user