aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-11 19:30:26 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 20:15:43 +0100
commitff4a628081c3fb50ea064353030a98375332cc23 (patch)
tree0ae0d88f876fe33cbaea21885234b3fac3d685a3
parentf389196a344591da2f6cc2a63f4953e34316f954 (diff)
downloadrneovim-ff4a628081c3fb50ea064353030a98375332cc23.tar.gz
rneovim-ff4a628081c3fb50ea064353030a98375332cc23.tar.bz2
rneovim-ff4a628081c3fb50ea064353030a98375332cc23.zip
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
-rw-r--r--src/nvim/testdir/Makefile2
-rw-r--r--src/nvim/testdir/test_alot.vim1
-rw-r--r--src/nvim/testdir/test_alot_latin.vim10
-rw-r--r--src/nvim/testdir/test_alot_utf8.vim12
-rw-r--r--src/nvim/testdir/test_expr_utf8.vim4
-rw-r--r--src/nvim/testdir/test_regexp_latin.vim32
6 files changed, 58 insertions, 3 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index aa5d534530..13fd0fcf62 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -109,6 +109,8 @@ NEW_TESTS ?= \
test_winbuf_close.res \
test_window_id.res \
test_writefile.res \
+ test_alot_latin.res \
+ test_alot_utf8.res \
test_alot.res
SCRIPTS_GUI := test16.out
diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim
index 735c4bb691..7bf65ba745 100644
--- a/src/nvim/testdir/test_alot.vim
+++ b/src/nvim/testdir/test_alot.vim
@@ -7,7 +7,6 @@ source test_cursor_func.vim
source test_ex_undo.vim
source test_execute_func.vim
source test_expr.vim
-source test_expr_utf8.vim
source test_feedkeys.vim
source test_filter_cmd.vim
source test_filter_map.vim
diff --git a/src/nvim/testdir/test_alot_latin.vim b/src/nvim/testdir/test_alot_latin.vim
new file mode 100644
index 0000000000..ebb3bde4ce
--- /dev/null
+++ b/src/nvim/testdir/test_alot_latin.vim
@@ -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
diff --git a/src/nvim/testdir/test_alot_utf8.vim b/src/nvim/testdir/test_alot_utf8.vim
new file mode 100644
index 0000000000..90b2aab467
--- /dev/null
+++ b/src/nvim/testdir/test_alot_utf8.vim
@@ -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
diff --git a/src/nvim/testdir/test_expr_utf8.vim b/src/nvim/testdir/test_expr_utf8.vim
index 9ea6d8872b..1737a9f745 100644
--- a/src/nvim/testdir/test_expr_utf8.vim
+++ b/src/nvim/testdir/test_expr_utf8.vim
@@ -3,7 +3,7 @@ if !has('multi_byte')
finish
endif
-func Test_strgetchar_utf8()
+func Test_strgetchar()
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
call assert_equal(char2nr('x'), strgetchar('áxb', 1))
@@ -16,7 +16,7 @@ func Test_strgetchar_utf8()
call assert_equal(char2nr('い'), strgetchar('あaい', 2))
endfunc
-func Test_strcharpart_utf8()
+func Test_strcharpart()
call assert_equal('áxb', strcharpart('áxb', 0))
call assert_equal('á', strcharpart('áxb', 0, 1))
call assert_equal('x', strcharpart('áxb', 1, 1))
diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim
new file mode 100644
index 0000000000..8528412806
--- /dev/null
+++ b/src/nvim/testdir/test_regexp_latin.vim
@@ -0,0 +1,32 @@
+" Tests for regexp in latin1 encoding
+set encoding=latin1
+scriptencoding latin1
+
+func s:equivalence_test()
+ let str = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y 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