From 03bba3256514adb431e0578ace829ef5bf04442c Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 3 Aug 2019 10:44:01 +0900 Subject: Change to set shellslash to test under same conditions as vim --- src/nvim/testdir/runtest.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index ce7d3b7ee4..82bc1f6950 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -77,7 +77,7 @@ set nomore lang mess C " Always use forward slashes. -" set shellslash +set shellslash " Prepare for calling test_garbagecollect_now(). let v:testing = 1 -- cgit From d7b642cadb0bda7780539f6eb2f27ac5283821ab Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 3 Aug 2019 10:56:47 +0900 Subject: Remove code that is no longer needed by set shellslash --- src/nvim/testdir/test_mksession.vim | 5 ++--- src/nvim/testdir/test_undo.vim | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index d77dac69c7..4e6d96ee48 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -206,11 +206,10 @@ func Test_mkview_loadview_with_viewdir() " The directory Xviewdir/ should have been created and the view " should be stored in that directory. - let pathsep = has('win32') ? '\' : '/' - call assert_equal('Xviewdir' . pathsep . + call assert_equal('Xviewdir/' . \ substitute( \ substitute( - \ expand('%:p'), pathsep, '=+', 'g'), ':', '=-', 'g') . '=1.vim', + \ expand('%:p'), '/', '=+', 'g'), ':', '=-', 'g') . '=1.vim', \ glob('Xviewdir/*')) call assert_equal(1, &number) call assert_match('\*:mkview\*$', getline('.')) diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim index 0cb5dc4033..86674889ef 100644 --- a/src/nvim/testdir/test_undo.vim +++ b/src/nvim/testdir/test_undo.vim @@ -376,10 +376,9 @@ funct Test_undofile() " Replace windows drive such as C:... into C%... let cwd = substitute(cwd, '^\([a-zA-Z]\):', '\1%', 'g') endif - let pathsep = has('win32') ? '\' : '/' - let cwd = substitute(cwd . pathsep . 'Xundofoo', pathsep, '%', 'g') + let cwd = substitute(cwd . '/Xundofoo', '/', '%', 'g') if has('persistent_undo') - call assert_equal('Xundodir' . pathsep . cwd, undofile('Xundofoo')) + call assert_equal('Xundodir/' . cwd, undofile('Xundofoo')) else call assert_equal('', undofile('Xundofoo')) endif -- cgit From 505d5fb960e1af7c78e7e589c729523c7da1c544 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 3 Aug 2019 14:54:21 +0900 Subject: Fix get_path_cutoff() on Windows Fix an issue where the result of get_path cutoff() was incorrect when using set shellslash. --- src/nvim/path.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/path.c b/src/nvim/path.c index 75a26d88c1..a58d57d566 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -852,8 +852,13 @@ static char_u *get_path_cutoff(char_u *fname, garray_T *gap) int j = 0; while ((fname[j] == path_part[i][j] - ) && fname[j] != NUL && path_part[i][j] != NUL) +#ifdef WIN32 + || (vim_ispathsep(fname[j]) && vim_ispathsep(path_part[i][j])) +#endif + ) // NOLINT(whitespace/parens) + && fname[j] != NUL && path_part[i][j] != NUL) { j++; + } if (j > maxlen) { maxlen = j; cutoff = &fname[j]; -- cgit From 619f1360752ad121426b5b352a05d28f8069b590 Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 5 Aug 2019 13:27:13 +0900 Subject: Add target fixff to testdir/Makefile In Windows, since conversion of the line feed code is necessary, porting fixff target from Make_mingw.mak of vim. --- src/nvim/testdir/Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 8b43d91e25..4b0db49bad 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -25,6 +25,12 @@ ifneq ($(OS),Windows_NT) endif +ifeq ($(OS),Windows_NT) + FIXFF = fixff +else + FIXFF = +endif + SCRIPTS ?= $(SCRIPTS_DEFAULT) # Tests using runtest.vim. @@ -74,7 +80,7 @@ ifdef TESTNUM SCRIPTS := test$(TESTNUM).out endif -nongui: nolog $(SCRIPTS) newtests report +nongui: nolog $(FIXFF) $(SCRIPTS) newtests report .gdbinit: @echo "[OLDTEST-PREP] Setting up .gdbinit" @@ -95,6 +101,16 @@ test1.out: $(NVIM_PRG) $(SCRIPTS): $(NVIM_PRG) test1.out +NO_PLUGINS = --noplugin --headless +NO_INITS = -U NONE $(NO_PLUGINS) + +# TODO: find a way to avoid changing the distributed files. +fixff: + -$(NVIM_PRG) -u unix.vim $(NO_INITS) "+argdo set ff=dos|upd" +q \ + *.in *.ok + -$(NVIM_PRG) -u unix.vim $(NO_INITS) "+argdo set ff=dos|upd" +q \ + dotest.in + RM_ON_RUN := test.out X* viminfo RM_ON_START := test.ok RUN_VIM := $(TOOL) $(NVIM_PRG) -u unix.vim -U NONE -i viminfo --headless --noplugin -s dotest.in -- cgit From 861a7604d4a5334c60c413c26c97f1d91e647335 Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 5 Aug 2019 23:15:22 +0900 Subject: Change test execution conditions Since neovim needs iconv to process cp932, it changes the test execution condition. --- src/nvim/testdir/test_increment_dbcs.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_increment_dbcs.vim b/src/nvim/testdir/test_increment_dbcs.vim index 474a16feeb..e5d5ccffb3 100644 --- a/src/nvim/testdir/test_increment_dbcs.vim +++ b/src/nvim/testdir/test_increment_dbcs.vim @@ -1,5 +1,7 @@ " Tests for using Ctrl-A/Ctrl-X using DBCS. -if !has('multi_byte') +" neovim needs an iconv to handle cp932. Please do not remove the following +" conditions. +if !has('iconv') finish endif scriptencoding cp932 -- cgit From 737074c8bf69ca737c9325558dafe137530bf184 Mon Sep 17 00:00:00 2001 From: erw7 Date: Wed, 7 Aug 2019 11:28:02 +0900 Subject: Remove test52 Test52 does nothing on UNIX. And vim on Windows performs mbyte-conversion between Unicode and code page using Windows API(See :h mbyte-conversion). Test52 seems to be testing its functionality. In neovim, the conversion function by Windows API has been removed. Therefore, there is no point in doing this test. --- src/nvim/testdir/Makefile | 1 - src/nvim/testdir/test52.in | 64 ---------------------------------------------- src/nvim/testdir/test52.ok | 18 ------------- 3 files changed, 83 deletions(-) delete mode 100644 src/nvim/testdir/test52.in delete mode 100644 src/nvim/testdir/test52.ok (limited to 'src') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 4b0db49bad..b72f55730f 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -16,7 +16,6 @@ export TMPDIR := $(abspath ../../../Xtest-tmpdir) SCRIPTS_DEFAULT = \ test42.out \ test48.out \ - test52.out \ test64.out \ ifneq ($(OS),Windows_NT) diff --git a/src/nvim/testdir/test52.in b/src/nvim/testdir/test52.in deleted file mode 100644 index fa75129193..0000000000 --- a/src/nvim/testdir/test52.in +++ /dev/null @@ -1,64 +0,0 @@ -Tests for reading and writing files with conversion for Win32. - -STARTTEST -:" make this a dummy test for non-Win32 systems -:if !has("win32") | e! test.ok | wq! test.out | endif -:" -:" write tests: -:" combine three values for 'encoding' with three values for 'fileencoding' -:" also write files for read tests -/^1 -:set encoding=utf-8 -:.w! ++enc=utf-8 test.out -:.w ++enc=cp1251 >>test.out -:.w ++enc=cp866 >>test.out -:.w! ++enc=utf-8 Xutf8 -/^2 -:set encoding=cp1251 -:.w ++enc=utf-8 >>test.out -:.w ++enc=cp1251 >>test.out -:.w ++enc=cp866 >>test.out -:.w! ++enc=cp1251 Xcp1251 -/^3 -:set encoding=cp866 -:.w ++enc=utf-8 >>test.out -:.w ++enc=cp1251 >>test.out -:.w ++enc=cp866 >>test.out -:.w! ++enc=cp866 Xcp866 -:" -:" read three 'fileencoding's with utf-8 'encoding' -:set encoding=utf-8 fencs=utf-8,cp1251 -:e Xutf8 -:.w ++enc=utf-8 >>test.out -:e Xcp1251 -:.w ++enc=utf-8 >>test.out -:set fencs=utf-8,cp866 -:e Xcp866 -:.w ++enc=utf-8 >>test.out -:" -:" read three 'fileencoding's with cp1251 'encoding' -:set encoding=utf-8 fencs=utf-8,cp1251 -:e Xutf8 -:.w ++enc=cp1251 >>test.out -:e Xcp1251 -:.w ++enc=cp1251 >>test.out -:set fencs=utf-8,cp866 -:e Xcp866 -:.w ++enc=cp1251 >>test.out -:" -:" read three 'fileencoding's with cp866 'encoding' -:set encoding=cp866 fencs=utf-8,cp1251 -:e Xutf8 -:.w ++enc=cp866 >>test.out -:e Xcp1251 -:.w ++enc=cp866 >>test.out -:set fencs=utf-8,cp866 -:e Xcp866 -:.w ++enc=cp866 >>test.out -:" -:qa! -ENDTEST - -1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -2 cp1251 text: Vim version 6.2. : 1970 Jan 01 -3 cp866 text: Vim version 6.2. ᫥ : 1970 Jan 01 diff --git a/src/nvim/testdir/test52.ok b/src/nvim/testdir/test52.ok deleted file mode 100644 index 90b516508d..0000000000 --- a/src/nvim/testdir/test52.ok +++ /dev/null @@ -1,18 +0,0 @@ -1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -1 utf-8 text: Vim version 6.2. : 1970 Jan 01 -1 utf-8 text: Vim version 6.2. ᫥ : 1970 Jan 01 -2 cp1251 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -2 cp1251 text: Vim version 6.2. : 1970 Jan 01 -2 cp1251 text: Vim version 6.2. ᫥ : 1970 Jan 01 -3 cp866 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -3 cp866 text: Vim version 6.2. : 1970 Jan 01 -3 cp866 text: Vim version 6.2. ᫥ : 1970 Jan 01 -1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -2 cp1251 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -3 cp866 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 -1 utf-8 text: Vim version 6.2. : 1970 Jan 01 -2 cp1251 text: Vim version 6.2. : 1970 Jan 01 -3 cp866 text: Vim version 6.2. : 1970 Jan 01 -1 utf-8 text: Vim version 6.2. ᫥ : 1970 Jan 01 -2 cp1251 text: Vim version 6.2. ᫥ : 1970 Jan 01 -3 cp866 text: Vim version 6.2. ᫥ : 1970 Jan 01 -- cgit From 44b3488db228f9a6b3af442cd2083d7e6f9a2e99 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 10 Aug 2019 11:32:54 +0900 Subject: Change value of cpo [skip travis] set cpo+=S was added because the test failed because the cpo value was different from vim(See #10730). --- src/nvim/testdir/test42.in | Bin 2354 -> 2438 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test42.in b/src/nvim/testdir/test42.in index 0ea0198d12..baa6e67d26 100644 Binary files a/src/nvim/testdir/test42.in and b/src/nvim/testdir/test42.in differ -- cgit From cc903210c9e276b34f60f0af25ba9d15f9a55370 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 17 Aug 2019 13:46:01 +0900 Subject: Fix test failure on Windows [skip travis] --- src/nvim/testdir/shared.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index ab0a4fd706..2169fbc4db 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -202,9 +202,17 @@ endfunc func GetVimProg() if empty($NVIM_TEST_ARG0) " Assume the script was sourced instead of running "make". - return '../../../build/bin/nvim' + if has('win32') + return '..\\..\\..\\build\\bin\\nvim.exe' + else + return '../../../build/bin/nvim' + endif + endif + if has('win32') + return substitute($NVIM_TEST_ARG0, '/', '\\', 'g') + else + return $NVIM_TEST_ARG0 endif - return $NVIM_TEST_ARG0 endfunc " Get the command to run Vim, with -u NONE and --headless arguments. -- cgit From 3453a2ccb07f7de4f0160b906a70a72ded89ca14 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sun, 18 Aug 2019 10:54:48 +0900 Subject: Change to use v:progpath instead of constant [skip ci] --- src/nvim/testdir/shared.vim | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 2169fbc4db..bcd6d021a0 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -202,11 +202,7 @@ endfunc func GetVimProg() if empty($NVIM_TEST_ARG0) " Assume the script was sourced instead of running "make". - if has('win32') - return '..\\..\\..\\build\\bin\\nvim.exe' - else - return '../../../build/bin/nvim' - endif + return v:progpath endif if has('win32') return substitute($NVIM_TEST_ARG0, '/', '\\', 'g') -- cgit