mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
test/old: restore test_alot_utf8.vim
Needed for later Vim patches. Stub test_alot_latin.vim to avoid merge-conflict noise. vim-patch:7.4.1700 vim-patch:7.4.1734 vim-patch:7.4.1740 vim-patch:7.4.2086 vim-patch:7.4.2223 vim-patch:8.0.0250
This commit is contained in:
@@ -109,6 +109,8 @@ NEW_TESTS ?= \
|
|||||||
test_winbuf_close.res \
|
test_winbuf_close.res \
|
||||||
test_window_id.res \
|
test_window_id.res \
|
||||||
test_writefile.res \
|
test_writefile.res \
|
||||||
|
test_alot_latin.res \
|
||||||
|
test_alot_utf8.res \
|
||||||
test_alot.res
|
test_alot.res
|
||||||
|
|
||||||
SCRIPTS_GUI := test16.out
|
SCRIPTS_GUI := test16.out
|
||||||
|
@@ -7,7 +7,6 @@ source test_cursor_func.vim
|
|||||||
source test_ex_undo.vim
|
source test_ex_undo.vim
|
||||||
source test_execute_func.vim
|
source test_execute_func.vim
|
||||||
source test_expr.vim
|
source test_expr.vim
|
||||||
source test_expr_utf8.vim
|
|
||||||
source test_feedkeys.vim
|
source test_feedkeys.vim
|
||||||
source test_filter_cmd.vim
|
source test_filter_cmd.vim
|
||||||
source test_filter_map.vim
|
source test_filter_map.vim
|
||||||
|
10
src/nvim/testdir/test_alot_latin.vim
Normal file
10
src/nvim/testdir/test_alot_latin.vim
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
" A series of tests that can run in one Vim invocation.
|
||||||
|
" This makes testing go faster, since Vim doesn't need to restart.
|
||||||
|
|
||||||
|
" These tests use latin1 'encoding'. Setting 'encoding' is in the individual
|
||||||
|
" files, so that they can be run by themselves.
|
||||||
|
|
||||||
|
" Nvim does not allow setting 'encoding', so skip this test group.
|
||||||
|
finish
|
||||||
|
|
||||||
|
source test_regexp_latin.vim
|
12
src/nvim/testdir/test_alot_utf8.vim
Normal file
12
src/nvim/testdir/test_alot_utf8.vim
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
" A series of tests that can run in one Vim invocation.
|
||||||
|
" This makes testing go faster, since Vim doesn't need to restart.
|
||||||
|
|
||||||
|
" These tests use utf8 'encoding'. Setting 'encoding' is already done in
|
||||||
|
" runtest.vim. Checking for the multi_byte feature is in the individual
|
||||||
|
" files, so that they can be run by themselves.
|
||||||
|
|
||||||
|
source test_expr_utf8.vim
|
||||||
|
source test_matchadd_conceal_utf8.vim
|
||||||
|
source test_regexp_utf8.vim
|
||||||
|
source test_source_utf8.vim
|
||||||
|
source test_utf8.vim
|
@@ -3,7 +3,7 @@ if !has('multi_byte')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
func Test_strgetchar_utf8()
|
func Test_strgetchar()
|
||||||
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
|
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
|
||||||
call assert_equal(char2nr('x'), strgetchar('áxb', 1))
|
call assert_equal(char2nr('x'), strgetchar('áxb', 1))
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ func Test_strgetchar_utf8()
|
|||||||
call assert_equal(char2nr('い'), strgetchar('あaい', 2))
|
call assert_equal(char2nr('い'), strgetchar('あaい', 2))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_strcharpart_utf8()
|
func Test_strcharpart()
|
||||||
call assert_equal('áxb', strcharpart('áxb', 0))
|
call assert_equal('áxb', strcharpart('áxb', 0))
|
||||||
call assert_equal('á', strcharpart('áxb', 0, 1))
|
call assert_equal('á', strcharpart('áxb', 0, 1))
|
||||||
call assert_equal('x', strcharpart('áxb', 1, 1))
|
call assert_equal('x', strcharpart('áxb', 1, 1))
|
||||||
|
32
src/nvim/testdir/test_regexp_latin.vim
Normal file
32
src/nvim/testdir/test_regexp_latin.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" Tests for regexp in latin1 encoding
|
||||||
|
set encoding=latin1
|
||||||
|
scriptencoding latin1
|
||||||
|
|
||||||
|
func s:equivalence_test()
|
||||||
|
let str = "A<><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD> B C D E<><45><EFBFBD><EFBFBD> F G H I<><49><EFBFBD><EFBFBD> J K L M N<> O<><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD> P Q R S T U<><55><EFBFBD><EFBFBD> V W X Y<> Z a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD> b c d e<><65><EFBFBD><EFBFBD> f g h i<><69><EFBFBD><EFBFBD> j k l m n<> o<><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD> p q r s t u<><75><EFBFBD><EFBFBD> v w x y<><79> z"
|
||||||
|
let groups = split(str)
|
||||||
|
for group1 in groups
|
||||||
|
for c in split(group1, '\zs')
|
||||||
|
" next statement confirms that equivalence class matches every
|
||||||
|
" character in group
|
||||||
|
call assert_match('^[[=' . c . '=]]*$', group1)
|
||||||
|
for group2 in groups
|
||||||
|
if group2 != group1
|
||||||
|
" next statement converts that equivalence class doesn't match
|
||||||
|
" a character in any other group
|
||||||
|
call assert_equal(-1, match(group2, '[[=' . c . '=]]'))
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_equivalence_re1()
|
||||||
|
set re=1
|
||||||
|
call s:equivalence_test()
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_equivalence_re2()
|
||||||
|
set re=2
|
||||||
|
call s:equivalence_test()
|
||||||
|
endfunc
|
Reference in New Issue
Block a user