mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #10679 from erw7/fix-oldtest-on-windows
This commit is contained in:
commit
d351f1c871
@ -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];
|
||||
|
@ -16,7 +16,6 @@ export TMPDIR := $(abspath ../../../Xtest-tmpdir)
|
||||
SCRIPTS_DEFAULT = \
|
||||
test42.out \
|
||||
test48.out \
|
||||
test52.out \
|
||||
test64.out \
|
||||
|
||||
ifneq ($(OS),Windows_NT)
|
||||
@ -25,6 +24,12 @@ ifneq ($(OS),Windows_NT)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
FIXFF = fixff
|
||||
else
|
||||
FIXFF =
|
||||
endif
|
||||
|
||||
SCRIPTS ?= $(SCRIPTS_DEFAULT)
|
||||
|
||||
# Tests using runtest.vim.
|
||||
@ -74,7 +79,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 +100,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
|
||||
|
@ -79,7 +79,7 @@ set nomore
|
||||
lang mess C
|
||||
|
||||
" Always use forward slashes.
|
||||
" set shellslash
|
||||
set shellslash
|
||||
|
||||
" Prepare for calling test_garbagecollect_now().
|
||||
let v:testing = 1
|
||||
|
@ -202,9 +202,13 @@ endfunc
|
||||
func GetVimProg()
|
||||
if empty($NVIM_TEST_ARG0)
|
||||
" Assume the script was sourced instead of running "make".
|
||||
return '../../../build/bin/nvim'
|
||||
return v:progpath
|
||||
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.
|
||||
|
Binary file not shown.
@ -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: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 1970 Jan 01
|
||||
2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
|
||||
3 cp866 text: „«ï Vim version 6.2. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
@ -1,18 +0,0 @@
|
||||
1 utf-8 text: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 1970 Jan 01
|
||||
1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
|
||||
1 utf-8 text: „«ï Vim version 6.2. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
||||
2 cp1251 text: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 1970 Jan 01
|
||||
2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
|
||||
2 cp1251 text: „«ï Vim version 6.2. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
||||
3 cp866 text: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 1970 Jan 01
|
||||
3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
|
||||
3 cp866 text: „«ï Vim version 6.2. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
||||
1 utf-8 text: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 1970 Jan 01
|
||||
2 cp1251 text: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 1970 Jan 01
|
||||
3 cp866 text: ДлÑ<C2BB> Vim version 6.2. ПоÑ<C2BE>леднее изменение: 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. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
||||
2 cp1251 text: „«ï Vim version 6.2. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
||||
3 cp866 text: „«ï Vim version 6.2. <20>®á«¥¤¥¥ ¨§¬¥¥¨¥: 1970 Jan 01
|
@ -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
|
||||
|
@ -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('.'))
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user