mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
vim-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)
966e58e413
This commit is contained in:
@@ -166,3 +166,20 @@ func Test_eow_with_optional()
|
||||
call assert_equal(expected, actual)
|
||||
endfor
|
||||
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