mirror of
https://github.com/neovim/neovim.git
synced 2026-07-11 03:49:41 +00:00
Introduce nvim namespace: Move files.
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.
This commit is contained in:
156
src/nvim/testdir/Makefile
Normal file
156
src/nvim/testdir/Makefile
Normal file
@@ -0,0 +1,156 @@
|
||||
#
|
||||
# Makefile to run all tests for Vim
|
||||
#
|
||||
|
||||
export SHELL := sh
|
||||
|
||||
VIMPROG := ../../build/bin/nvim
|
||||
|
||||
SCRIPTS := test_eval.out \
|
||||
test1.out test2.out test3.out test4.out test5.out \
|
||||
test6.out test7.out test8.out test9.out test10.out \
|
||||
test11.out test12.out test13.out test14.out test15.out \
|
||||
test17.out test18.out test19.out test20.out \
|
||||
test21.out test22.out test23.out test24.out test25.out \
|
||||
test26.out test27.out test28.out test29.out test30.out \
|
||||
test31.out test32.out test33.out test34.out test35.out \
|
||||
test36.out test37.out test38.out test39.out test40.out \
|
||||
test41.out test42.out test43.out test44.out test45.out \
|
||||
test46.out test47.out test48.out test49.out \
|
||||
test51.out test52.out test53.out test54.out test55.out \
|
||||
test56.out test57.out test58.out test59.out test60.out \
|
||||
test61.out test62.out test63.out test64.out test65.out \
|
||||
test66.out test67.out test68.out test69.out test70.out \
|
||||
test71.out test72.out test73.out test74.out test75.out \
|
||||
test76.out test77.out test78.out test79.out test80.out \
|
||||
test81.out test82.out test83.out test84.out test85.out \
|
||||
test86.out test87.out test88.out test89.out test90.out \
|
||||
test91.out test92.out test93.out test94.out test95.out \
|
||||
test96.out test97.out test98.out test99.out test100.out \
|
||||
test101.out test102.out test103.out test104.out test105.out \
|
||||
test106.out
|
||||
|
||||
SCRIPTS_GUI := test16.out
|
||||
|
||||
|
||||
ifdef VALGRIND_GDB
|
||||
VGDB := --vgdb=yes \
|
||||
--vgdb-error=0
|
||||
endif
|
||||
|
||||
ifdef USE_VALGRIND
|
||||
VALGRIND_TOOL := --tool=memcheck \
|
||||
--leak-check=yes \
|
||||
--track-origins=yes
|
||||
# VALGRIND_TOOL := exp-sgcheck
|
||||
TOOL := valgrind -q \
|
||||
-q \
|
||||
$(VALGRIND_TOOL) \
|
||||
--suppressions=../../.valgrind.supp \
|
||||
--error-exitcode=123 \
|
||||
--log-file=valgrind.\%p.$* \
|
||||
$(VGDB) \
|
||||
--trace-children=yes
|
||||
else
|
||||
ifdef USE_GDB
|
||||
TOOL = gdb --args
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef TESTNUM
|
||||
SCRIPTS := test$(TESTNUM).out
|
||||
endif
|
||||
|
||||
nongui: nolog $(SCRIPTS) report
|
||||
|
||||
gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report
|
||||
|
||||
.gdbinit:
|
||||
echo 'set $$_exitcode = -1\nrun\nif $$_exitcode != -1\n quit\nend' > .gdbinit
|
||||
|
||||
report:
|
||||
@echo
|
||||
@echo 'Test results:'
|
||||
@/bin/sh -c "if test -f test.log; then \
|
||||
cat test.log; \
|
||||
echo TEST FAILURE; \
|
||||
exit 1; \
|
||||
else \
|
||||
echo ALL DONE; \
|
||||
fi"
|
||||
|
||||
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
|
||||
|
||||
RM_ON_RUN := test.out X* viminfo
|
||||
RM_ON_START := tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok
|
||||
RUN_VIM := $(TOOL) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in
|
||||
|
||||
clean:
|
||||
-rm -rf *.out \
|
||||
*.failed \
|
||||
*.rej \
|
||||
*.orig \
|
||||
test.log \
|
||||
$(RM_ON_RUN) \
|
||||
$(RM_ON_START) \
|
||||
valgrind.* \
|
||||
.*.swp \
|
||||
.*.swo
|
||||
|
||||
test1.out: .gdbinit test1.in
|
||||
-rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize
|
||||
$(RUN_VIM) $*.in
|
||||
@/bin/sh -c "if test -e wrongtermsize; then \
|
||||
echo; \
|
||||
echo test1 FAILED - terminal size must be 80x24 or larger; \
|
||||
echo; exit 1; \
|
||||
elif diff test.out $*.ok; then \
|
||||
mv -f test.out $*.out; \
|
||||
else \
|
||||
echo; \
|
||||
echo test1 FAILED - Something basic is wrong; \
|
||||
echo; \
|
||||
exit 1; \
|
||||
fi"
|
||||
-rm -rf X* viminfo
|
||||
|
||||
%.out: %.in .gdbinit
|
||||
-rm -rf $*.failed test.ok $(RM_ON_RUN)
|
||||
cp $*.ok test.ok
|
||||
# Sleep a moment to avoid that the xterm title is messed up.
|
||||
# 200 msec is sufficient, but only modern sleep supports a fraction of
|
||||
# a second, fall back to a second if it fails.
|
||||
@-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1"
|
||||
$(RUN_VIM) $*.in
|
||||
|
||||
# For flaky tests retry one time.
|
||||
@/bin/sh -c "if test -f test.out -a $* = test61; then \
|
||||
if diff test.out $*.ok; then \
|
||||
echo flaky test ok first time; \
|
||||
else rm -rf $*.failed $(RM_ON_RUN); \
|
||||
$(RUN_VIM) $*.in; \
|
||||
fi; \
|
||||
fi"
|
||||
|
||||
# Check if the test.out file matches test.ok.
|
||||
@/bin/sh -c "if test -f test.out; then \
|
||||
if diff test.out $*.ok; then \
|
||||
mv -f test.out $*.out; \
|
||||
else \
|
||||
echo $* FAILED >> test.log; \
|
||||
mv -f test.out $*.failed; \
|
||||
fi; \
|
||||
else \
|
||||
echo $* NO OUTPUT >>test.log; \
|
||||
fi"
|
||||
@/bin/sh -c "if test -f valgrind; then \
|
||||
mv -f valgrind valgrind.$*; \
|
||||
fi"
|
||||
-rm -rf X* test.ok viminfo
|
||||
|
||||
test49.out: test49.vim
|
||||
|
||||
test60.out: test60.vim
|
||||
|
||||
nolog:
|
||||
-rm -f test.log
|
||||
3
src/nvim/testdir/dotest.in
Normal file
3
src/nvim/testdir/dotest.in
Normal file
@@ -0,0 +1,3 @@
|
||||
:set cp
|
||||
:map dotest /^STARTTEST
|
||||
j:set ff=unix cpo-=A
|
||||
1
src/nvim/testdir/sautest/autoload/Test104.vim
Normal file
1
src/nvim/testdir/sautest/autoload/Test104.vim
Normal file
@@ -0,0 +1 @@
|
||||
let Test104#numvar = 123
|
||||
5
src/nvim/testdir/sautest/autoload/footest.vim
Normal file
5
src/nvim/testdir/sautest/autoload/footest.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
" Autoload script used by test55 and test60
|
||||
let footest#x = 1
|
||||
func footest#F()
|
||||
return 0
|
||||
endfunc
|
||||
57
src/nvim/testdir/test1.in
Normal file
57
src/nvim/testdir/test1.in
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
First a simple test to check if the test script works.
|
||||
|
||||
If Vim was not compiled with the +eval feature, the small.vim script will be
|
||||
set to copy the test.ok file to test.out, so that it looks like the test
|
||||
succeeded. Otherwise an empty small.vim is written. small.vim is sourced by
|
||||
tests that require the +eval feature or other features that are missing in the
|
||||
small version.
|
||||
|
||||
If Vim was not compiled with the +windows feature, the tiny.vim script will be
|
||||
set like small.vim above. tiny.vim is sourced by tests that require the
|
||||
+windows feature or other features that are missing in the tiny version.
|
||||
|
||||
If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will
|
||||
be set like small.vim above. mbyte.vim is sourced by tests that require the
|
||||
+multi_byte feature.
|
||||
Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
|
||||
Similar logic is applied to the +lua feature, using lua.vim.
|
||||
|
||||
STARTTEST
|
||||
:" If columns or lines are too small, create wrongtermsize.
|
||||
:" (Some tests will fail. When columns and/or lines are small)
|
||||
:if &lines < 24 || &columns < 80 | sp another | w! wrongtermsize | qa! | endif
|
||||
:"
|
||||
:" Write a single line to test.out to check if testing works at all.
|
||||
:%d
|
||||
athis is a test:w! test.out
|
||||
:" Create small.vim and tiny.vim empty, create mbyte.vim to skip the test.
|
||||
0D:w! small.vim
|
||||
:w! tiny.vim
|
||||
ae! test.ok
|
||||
w! test.out
|
||||
qa!
|
||||
:w! mbyte.vim
|
||||
:w! mzscheme.vim
|
||||
:w! lua.vim
|
||||
:"
|
||||
:" If +multi_byte feature supported, make mbyte.vim empty.
|
||||
:if has("multi_byte") | sp another | w! mbyte.vim | q | endif
|
||||
:"
|
||||
:" If +mzscheme feature supported, make mzscheme.vim empty.
|
||||
:if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
|
||||
:"
|
||||
:" If +lua feature supported, make lua.vim empty.
|
||||
:if has("lua") | sp another | w! lua.vim | q | endif
|
||||
:"
|
||||
:" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
|
||||
:" Otherwise write small.vim to skip the test.
|
||||
:if 1 | q! | endif
|
||||
:w! small.vim
|
||||
:" If +windows feature not supported :sp will fail and tiny.vim will be
|
||||
:" written to skip the test.
|
||||
:sp another
|
||||
:wq! tiny.vim
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
1
src/nvim/testdir/test1.ok
Normal file
1
src/nvim/testdir/test1.ok
Normal file
@@ -0,0 +1 @@
|
||||
this is a test
|
||||
114
src/nvim/testdir/test10.in
Normal file
114
src/nvim/testdir/test10.in
Normal file
@@ -0,0 +1,114 @@
|
||||
Test for 'errorformat'. This will fail if the quickfix feature was disabled.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" Also test a BOM is ignored.
|
||||
:so mbyte.vim
|
||||
:set encoding=utf-8
|
||||
:7/start of errorfile/,/end of errorfile/w! Xerrorfile1
|
||||
:7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2
|
||||
:/start of testfile/,/end of testfile/w! Xtestfile
|
||||
:set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m
|
||||
:set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m
|
||||
:cf Xerrorfile2
|
||||
:clast
|
||||
:copen
|
||||
:let a=w:quickfix_title
|
||||
:wincmd p
|
||||
lgR=a
|
||||
|
||||
:cf Xerrorfile1
|
||||
grA
|
||||
:cn
|
||||
gRLINE 6, COL 19
|
||||
:cn
|
||||
gRNO COLUMN SPECIFIED
|
||||
:cn
|
||||
gRAGAIN NO COLUMN
|
||||
:cn
|
||||
gRCOL 1
|
||||
:cn
|
||||
gRCOL 2
|
||||
:cn
|
||||
gRCOL 10
|
||||
:cn
|
||||
gRVCOL 10
|
||||
:cn
|
||||
grI
|
||||
:cn
|
||||
gR. SPACE POINTER
|
||||
:cn
|
||||
gR. DOT POINTER
|
||||
:cn
|
||||
gR. DASH POINTER
|
||||
:cn
|
||||
gR. TAB-SPACE POINTER
|
||||
:clast
|
||||
:cprev
|
||||
:cprev
|
||||
:wincmd w
|
||||
:let a=w:quickfix_title
|
||||
:wincmd p
|
||||
lgR=a
|
||||
|
||||
:w! test.out " Write contents of this file
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of errorfile
|
||||
"Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
|
||||
"Xtestfile", line 6 col 19; this is an error
|
||||
gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
|
||||
Xtestfile:9: parse error before `asd'
|
||||
make: *** [vim] Error 1
|
||||
in file "Xtestfile" linenr 10: there is an error
|
||||
|
||||
2 returned
|
||||
"Xtestfile", line 11 col 1; this is an error
|
||||
"Xtestfile", line 12 col 2; this is another error
|
||||
"Xtestfile", line 14:10; this is an error in column 10
|
||||
=Xtestfile=, line 15:10; this is another error, but in vcol 10 this time
|
||||
"Xtestfile", linenr 16: yet another problem
|
||||
Error in "Xtestfile" at line 17:
|
||||
x should be a dot
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
|
||||
^
|
||||
Error in "Xtestfile" at line 18:
|
||||
x should be a dot
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
|
||||
.............^
|
||||
Error in "Xtestfile" at line 19:
|
||||
x should be a dot
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
|
||||
--------------^
|
||||
Error in "Xtestfile" at line 20:
|
||||
x should be a dot
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
|
||||
^
|
||||
|
||||
Does anyone know what is the problem and how to correction it?
|
||||
"Xtestfile", line 21 col 9: What is the title of the quickfix window?
|
||||
"Xtestfile", line 22 col 9: What is the title of the quickfix window?
|
||||
end of errorfile
|
||||
|
||||
start of testfile
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21
|
||||
23
src/nvim/testdir/test10.ok
Normal file
23
src/nvim/testdir/test10.ok
Normal file
@@ -0,0 +1,23 @@
|
||||
start of testfile
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
|
||||
xxxxxxxxxxAxxxxxxxxxxxxxxxxxxx line 4
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
|
||||
xxxxxxxxxxxxxxxxxLINE 6, COL 19 line 6
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
|
||||
NO COLUMN SPECIFIEDxxxxxxxxxxx line 9
|
||||
AGAIN NO COLUMNxxxxxxxxxxxxxxx line 10
|
||||
COL 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
|
||||
COL 2xxxxxxxxxxxxxxxxxxxxxxxxx line 12
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
|
||||
xxxxxxxxCOL 10xxxxxxxxxxxxxxxx line 14
|
||||
xVCOL 10xxxxxxxxxxxxxxxxxxxxxx line 15
|
||||
Ixxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
|
||||
xxxx. SPACE POINTERxxxxxxxxxxx line 17
|
||||
xxxxx. DOT POINTERxxxxxxxxxxxx line 18
|
||||
xxxxxx. DASH POINTERxxxxxxxxxx line 19
|
||||
xxxxxxx. TAB-SPACE POINTERxxxx line 20
|
||||
xxxxxxxx:cf Xerrorfile1xxxxxxx line 21
|
||||
xxxxxxxx:cf Xerrorfile2xxxxxxx line 22
|
||||
end of testfile
|
||||
42
src/nvim/testdir/test100.in
Normal file
42
src/nvim/testdir/test100.in
Normal file
@@ -0,0 +1,42 @@
|
||||
Tests for 'undolevel' setting being global-local
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocompatible viminfo+=nviminfo ul=5
|
||||
:fu! FillBuffer()
|
||||
:for i in range(1,13)
|
||||
:put=i
|
||||
:exe "setg ul=" . &g:ul
|
||||
:endfor
|
||||
:endfu
|
||||
:fu! UndoLevel()
|
||||
:redir @a | setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |redir end
|
||||
:$put a
|
||||
:endfu
|
||||
:new one
|
||||
:0put ='ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'
|
||||
:call FillBuffer()
|
||||
:call feedkeys(":earlier 10\n", 't')
|
||||
:call UndoLevel()
|
||||
:%w! test.out
|
||||
:new two
|
||||
:0put ='TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)'
|
||||
:setlocal ul=2
|
||||
:call FillBuffer()
|
||||
:call feedkeys(":earlier 10\n", 't')
|
||||
:call UndoLevel()
|
||||
:setlocal ul=10
|
||||
:call UndoLevel()
|
||||
:%w >> test.out
|
||||
:wincmd p
|
||||
:redir >>test.out | echo "global value shouldn't be changed and still be 5!" | echo 'ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'|:setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |echo "" |redir end
|
||||
:new three
|
||||
:setglobal ul=50
|
||||
:1put ='global value should be changed to 50'
|
||||
:2put ='THREE: expecting global undolevels: 50, local undolevels: -123456 (default)'
|
||||
:call UndoLevel()
|
||||
:%w >> test.out
|
||||
:"sleep 10
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
41
src/nvim/testdir/test100.ok
Normal file
41
src/nvim/testdir/test100.ok
Normal file
@@ -0,0 +1,41 @@
|
||||
ONE: expecting global undolevels: 5, local undolevels: -123456 (default)
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
|
||||
|
||||
undolevels=5 global
|
||||
undolevels=-123456 local
|
||||
TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
|
||||
|
||||
undolevels=5 global
|
||||
undolevels=2 local
|
||||
|
||||
undolevels=5 global
|
||||
undolevels=10 local
|
||||
|
||||
global value shouldn't be changed and still be 5!
|
||||
ONE: expecting global undolevels: 5, local undolevels: -123456 (default)
|
||||
undolevels=5 global
|
||||
undolevels=-123456 local
|
||||
|
||||
global value should be changed to 50
|
||||
THREE: expecting global undolevels: 50, local undolevels: -123456 (default)
|
||||
|
||||
undolevels=50 global
|
||||
undolevels=-123456 local
|
||||
45
src/nvim/testdir/test101.in
Normal file
45
src/nvim/testdir/test101.in
Normal file
@@ -0,0 +1,45 @@
|
||||
Test for v:hlsearch vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
:" Last abc: Q
|
||||
:so small.vim
|
||||
:new
|
||||
:call setline(1, repeat(['aaa'], 10))
|
||||
:set hlsearch nolazyredraw
|
||||
:let r=[]
|
||||
:command -nargs=0 -bar AddR :call add(r, [screenattr(1, 1), v:hlsearch])
|
||||
/aaa
|
||||
:AddR
|
||||
:nohlsearch
|
||||
:AddR
|
||||
:let v:hlsearch=1
|
||||
:AddR
|
||||
:let v:hlsearch=0
|
||||
:AddR
|
||||
:set hlsearch
|
||||
:AddR
|
||||
:let v:hlsearch=0
|
||||
:AddR
|
||||
n:AddR
|
||||
:let v:hlsearch=0
|
||||
:AddR
|
||||
/
|
||||
:AddR
|
||||
:let r1=r[0][0]
|
||||
:" I guess it is not guaranteed that screenattr outputs always the same character
|
||||
:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
|
||||
:try
|
||||
: let v:hlsearch=[]
|
||||
:catch
|
||||
: call add(r, matchstr(v:exception,'^Vim(let):E\d\+:'))
|
||||
:endtry
|
||||
:bwipeout!
|
||||
:$put=r
|
||||
:call garbagecollect(1)
|
||||
:"
|
||||
:/^start:/,$wq! test.out
|
||||
:" vim: et ts=4 isk-=\:
|
||||
:call getchar()
|
||||
ENDTEST
|
||||
|
||||
start:
|
||||
11
src/nvim/testdir/test101.ok
Normal file
11
src/nvim/testdir/test101.ok
Normal file
@@ -0,0 +1,11 @@
|
||||
start:
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
Vim(let):E706:
|
||||
12
src/nvim/testdir/test102.in
Normal file
12
src/nvim/testdir/test102.in
Normal file
@@ -0,0 +1,12 @@
|
||||
Test if fnameescape is correct for special chars like !
|
||||
|
||||
STARTTEST
|
||||
:%d
|
||||
:let fname = 'Xspa ce'
|
||||
:try | exe "w! " . fnameescape(fname) | put='Space' | endtry
|
||||
:let fname = 'Xemark!'
|
||||
:try | exe "w! " . fnameescape(fname) | put='ExclamationMark' | endtry
|
||||
:w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
3
src/nvim/testdir/test102.ok
Normal file
3
src/nvim/testdir/test102.ok
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
Space
|
||||
ExclamationMark
|
||||
37
src/nvim/testdir/test103.in
Normal file
37
src/nvim/testdir/test103.in
Normal file
@@ -0,0 +1,37 @@
|
||||
Test for visual mode not being reset causing E315 error.
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:enew
|
||||
:let g:msg="Everything's fine."
|
||||
:function! TriggerTheProblem()
|
||||
: " At this point there is no visual selection because :call reset it.
|
||||
: " Let's restore the selection:
|
||||
: normal gv
|
||||
: '<,'>del _
|
||||
: try
|
||||
: exe "normal \<Esc>"
|
||||
: catch /^Vim\%((\a\+)\)\=:E315/
|
||||
: echom 'Snap! E315 error!'
|
||||
: let g:msg='Snap! E315 error!'
|
||||
: endtry
|
||||
:endfunction
|
||||
:enew
|
||||
:setl buftype=nofile
|
||||
:call append(line('$'), 'Delete this line.')
|
||||
:"
|
||||
:"
|
||||
:" NOTE: this has to be done by a call to a function because executing :del the
|
||||
:" ex-way will require the colon operator which resets the visual mode thus
|
||||
:" preventing the problem:
|
||||
:"
|
||||
GV:call TriggerTheProblem()
|
||||
:%del _
|
||||
:call append(line('$'), g:msg)
|
||||
:w! test.out
|
||||
:brewind
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
2
src/nvim/testdir/test103.ok
Normal file
2
src/nvim/testdir/test103.ok
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
Everything's fine.
|
||||
30
src/nvim/testdir/test104.in
Normal file
30
src/nvim/testdir/test104.in
Normal file
@@ -0,0 +1,30 @@
|
||||
Tests for :let. vim: set ft=vim ts=8 :
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set runtimepath+=./sautest
|
||||
:" Test to not autoload when assigning. It causes internal error.
|
||||
:try
|
||||
: let Test104#numvar = function('tr')
|
||||
: $put ='OK: ' . string(Test104#numvar)
|
||||
:catch
|
||||
: $put ='FAIL: ' . v:exception
|
||||
:endtry
|
||||
:let a = 1
|
||||
:let b = 2
|
||||
:for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}']
|
||||
: try
|
||||
: redir => messages
|
||||
: execute 'let' letargs
|
||||
: redir END
|
||||
: $put ='OK:'
|
||||
: $put =split(substitute(messages, '\n', '\0 ', 'g'), '\n')
|
||||
: catch
|
||||
: $put ='FAIL: ' . v:exception
|
||||
: redir END
|
||||
: endtry
|
||||
:endfor
|
||||
:/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
Results of test104:
|
||||
13
src/nvim/testdir/test104.ok
Normal file
13
src/nvim/testdir/test104.ok
Normal file
@@ -0,0 +1,13 @@
|
||||
Results of test104:
|
||||
OK: function('tr')
|
||||
OK:
|
||||
a #1
|
||||
b #2
|
||||
OK:
|
||||
b #2
|
||||
OK:
|
||||
b #2
|
||||
a #1
|
||||
OK:
|
||||
a #1
|
||||
b #2
|
||||
45
src/nvim/testdir/test105.in
Normal file
45
src/nvim/testdir/test105.in
Normal file
@@ -0,0 +1,45 @@
|
||||
Test filename modifiers vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
:source small.vim
|
||||
:%delete _
|
||||
:set shell=sh
|
||||
:set shellslash
|
||||
:let tab="\t"
|
||||
:command -nargs=1 Put :let expr=<q-args> | $put =expr.tab.strtrans(string(eval(expr)))
|
||||
:let $HOME=fnamemodify('.', ':p:h:h:h')
|
||||
:Put fnamemodify('.', ':p' )[-1:]
|
||||
:Put fnamemodify('.', ':p:h' )[-1:]
|
||||
:Put fnamemodify('test.out', ':p' )[-1:]
|
||||
:Put fnamemodify('test.out', ':.' )
|
||||
:Put fnamemodify('../testdir/a', ':.' )
|
||||
:Put fnamemodify('test.out', ':~' )
|
||||
:Put fnamemodify('../testdir/a', ':~' )
|
||||
:Put fnamemodify('../testdir/a', ':t' )
|
||||
:Put fnamemodify('.', ':p:t' )
|
||||
:Put fnamemodify('test.out', ':p:t' )
|
||||
:Put fnamemodify('test.out', ':p:e' )
|
||||
:Put fnamemodify('test.out', ':p:t:e' )
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':r' )
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':r:r' )
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':r:r:r' )
|
||||
:Put substitute(fnamemodify('abc.fb2.tar.gz', ':p:r:r'), '.*\(src/testdir/.*\)', '\1', '')
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':e' )
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':e:e' )
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':e:e:e' )
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':e:e:e:e')
|
||||
:Put fnamemodify('abc.fb2.tar.gz', ':e:e:r' )
|
||||
:Put fnamemodify('abc def', ':S' )
|
||||
:Put fnamemodify('abc" "def', ':S' )
|
||||
:Put fnamemodify('abc"%"def', ':S' )
|
||||
:Put fnamemodify('abc'' ''def', ':S' )
|
||||
:Put fnamemodify('abc''%''def', ':S' )
|
||||
:Put fnamemodify("abc\ndef", ':S' )
|
||||
:set shell=tcsh
|
||||
:Put fnamemodify("abc\ndef", ':S' )
|
||||
:$put ='vim: ts=8'
|
||||
:1 delete _
|
||||
:w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
29
src/nvim/testdir/test105.ok
Normal file
29
src/nvim/testdir/test105.ok
Normal file
@@ -0,0 +1,29 @@
|
||||
fnamemodify('.', ':p' )[-1:] '/'
|
||||
fnamemodify('.', ':p:h' )[-1:] 'r'
|
||||
fnamemodify('test.out', ':p' )[-1:] 't'
|
||||
fnamemodify('test.out', ':.' ) 'test.out'
|
||||
fnamemodify('../testdir/a', ':.' ) 'a'
|
||||
fnamemodify('test.out', ':~' ) '~/src/testdir/test.out'
|
||||
fnamemodify('../testdir/a', ':~' ) '~/src/testdir/a'
|
||||
fnamemodify('../testdir/a', ':t' ) 'a'
|
||||
fnamemodify('.', ':p:t' ) ''
|
||||
fnamemodify('test.out', ':p:t' ) 'test.out'
|
||||
fnamemodify('test.out', ':p:e' ) 'out'
|
||||
fnamemodify('test.out', ':p:t:e' ) 'out'
|
||||
fnamemodify('abc.fb2.tar.gz', ':r' ) 'abc.fb2.tar'
|
||||
fnamemodify('abc.fb2.tar.gz', ':r:r' ) 'abc.fb2'
|
||||
fnamemodify('abc.fb2.tar.gz', ':r:r:r' ) 'abc'
|
||||
substitute(fnamemodify('abc.fb2.tar.gz', ':p:r:r'), '.*\(src/testdir/.*\)', '\1', '') 'src/testdir/abc.fb2'
|
||||
fnamemodify('abc.fb2.tar.gz', ':e' ) 'gz'
|
||||
fnamemodify('abc.fb2.tar.gz', ':e:e' ) 'tar.gz'
|
||||
fnamemodify('abc.fb2.tar.gz', ':e:e:e' ) 'fb2.tar.gz'
|
||||
fnamemodify('abc.fb2.tar.gz', ':e:e:e:e') 'fb2.tar.gz'
|
||||
fnamemodify('abc.fb2.tar.gz', ':e:e:r' ) 'tar'
|
||||
fnamemodify('abc def', ':S' ) '''abc def'''
|
||||
fnamemodify('abc" "def', ':S' ) '''abc" "def'''
|
||||
fnamemodify('abc"%"def', ':S' ) '''abc"%"def'''
|
||||
fnamemodify('abc'' ''def', ':S' ) '''abc''\'''' ''\''''def'''
|
||||
fnamemodify('abc''%''def', ':S' ) '''abc''\''''%''\''''def'''
|
||||
fnamemodify("abc\ndef", ':S' ) '''abc^@def'''
|
||||
fnamemodify("abc\ndef", ':S' ) '''abc\^@def'''
|
||||
vim: ts=8
|
||||
16
src/nvim/testdir/test106.in
Normal file
16
src/nvim/testdir/test106.in
Normal file
@@ -0,0 +1,16 @@
|
||||
Tests for errorformat. vim: set ft=vim ts=8 :
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:if !has('quickfix') | e! test.ok | wq! test.out | endif
|
||||
:set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%#
|
||||
:cgetexpr ['WWWW', 'EEEE', 'CCCC']
|
||||
:$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))
|
||||
:cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC']
|
||||
:$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))
|
||||
:cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY']
|
||||
:$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))
|
||||
:/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
Results of test106:
|
||||
4
src/nvim/testdir/test106.ok
Normal file
4
src/nvim/testdir/test106.ok
Normal file
@@ -0,0 +1,4 @@
|
||||
Results of test106:
|
||||
[['W', 1], ['E^@CCCC', 1]]
|
||||
[['W', 1], ['E^@CCCC', 1]]
|
||||
[['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]
|
||||
73
src/nvim/testdir/test10a.in
Normal file
73
src/nvim/testdir/test10a.in
Normal file
@@ -0,0 +1,73 @@
|
||||
Test for 'errorformat'.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:/start of errorfile/,/end of errorfile/w! Xerrorfile
|
||||
:/start of testfile/,/end of testfile/w! Xtestfile
|
||||
:cf Xerrorfile
|
||||
rA
|
||||
:cn
|
||||
rB
|
||||
:cn
|
||||
rC
|
||||
:cn
|
||||
rD
|
||||
:cn
|
||||
rE
|
||||
:w! test.out " Write contents of this file
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of errorfile
|
||||
|
||||
printf(" %d \n", (number/other)%10 );
|
||||
..................^
|
||||
%CC-E-NOSEMI, Missing ";".
|
||||
at line number 4 in file SYS$DISK:XTESTFILE
|
||||
|
||||
other=10000000;
|
||||
.............^
|
||||
%CC-E-UNDECLARED, In this statement, "oszt" is not declared.
|
||||
at line number 7 in file SYS$DISK:XTESTFILE
|
||||
|
||||
for (i = 0; i<7 ; i++ ){
|
||||
..................^
|
||||
%CC-E-UNDECLARED, In this statement, "i" is not declared.
|
||||
at line number 16 in file SYS$DISK:XTESTFILE
|
||||
|
||||
some other error somewhere here.
|
||||
...........................^
|
||||
%CC-W-WARRING, Sorry, but no expalnation for such an warring.
|
||||
at line number 19 in file SYS$DISK:XTESTFILE
|
||||
|
||||
and finally some other error exactly here.
|
||||
.....................................^
|
||||
%CC-I-INFORMATIONAL, It should be some informational message.
|
||||
at line number 20 in file SYS$DISK:XTESTFILE
|
||||
|
||||
Does anyone know what is the problem and how to correct ?? :)
|
||||
end of errorfile
|
||||
|
||||
start of testfile
|
||||
01234567890123456789012345678901234567
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
end of testfile
|
||||
23
src/nvim/testdir/test10a.ok
Normal file
23
src/nvim/testdir/test10a.ok
Normal file
@@ -0,0 +1,23 @@
|
||||
start of testfile
|
||||
01234567890123456789012345678901234567
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 4 xxxxxxxxxxAxxxxxxxxxxxxxxxxxxx
|
||||
line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 7 xxxxxBxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 16 xxxxxxxxxxCxxxxxxxxxxxxxxxxxxx
|
||||
line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 19 xxxxxxxxxxxxxxxxxxxDxxxxxxxxxx
|
||||
line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxE
|
||||
line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
end of testfile
|
||||
84
src/nvim/testdir/test11.in
Normal file
84
src/nvim/testdir/test11.in
Normal file
@@ -0,0 +1,84 @@
|
||||
Tests for autocommands:
|
||||
- FileWritePre writing a compressed file
|
||||
- FileReadPost reading a compressed file
|
||||
- BufNewFile reading a file template
|
||||
- BufReadPre decompressing the file to be read
|
||||
- FilterReadPre substituting characters in the temp file
|
||||
- FilterReadPost substituting characters after filtering
|
||||
- FileReadPre set options for decompression
|
||||
- FileReadPost decompress the file
|
||||
|
||||
Note: This test is skipped if "gzip" is not available.
|
||||
$GZIP is made empty, "-v" would cause trouble.
|
||||
Use a FileChangedShell autocommand to avoid a prompt for "Xtestfile.gz" being
|
||||
modified outside of Vim (noticed on Solaris).
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" drop out when there is no gzip program
|
||||
:if !executable("gzip")
|
||||
: e! test.ok
|
||||
: w! test.out
|
||||
: qa!
|
||||
:endif
|
||||
:let $GZIP = ""
|
||||
:au FileChangedShell * echo "caught FileChangedShell"
|
||||
:set bin
|
||||
:au FileWritePre *.gz '[,']!gzip
|
||||
:au FileWritePost *.gz undo
|
||||
:/^start of testfile/,/^end of testfile/w! Xtestfile.gz
|
||||
:au FileReadPost *.gz '[,']!gzip -d
|
||||
:$r Xtestfile.gz " Read and decompress the testfile
|
||||
:?startstart?,$w! test.out " Write contents of this file
|
||||
:au BufNewFile *.c read Xtest.c
|
||||
:/^start of test.c/+1,/^end of test.c/-1w! Xtest.c
|
||||
:e! foo.c " Will load Xtest.c
|
||||
:au FileAppendPre *.out '[,']s/new/NEW/
|
||||
:au FileAppendPost *.out !cat Xtest.c >>test.out
|
||||
:w>>test.out " Append it to the output file
|
||||
:au! FileAppendPre
|
||||
:" setup autocommands to decompress before reading and re-compress afterwards
|
||||
:au BufReadPre *.gz exe '!gzip -d ' . shellescape(expand("<afile>"))
|
||||
:au BufReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
|
||||
:au BufReadPost *.gz call rename(expand("<afile>"), expand("<afile>:r"))
|
||||
:au BufReadPost *.gz exe '!gzip ' . shellescape(expand("<afile>:r"))
|
||||
:e! Xtestfile.gz " Edit compressed file
|
||||
:w>>test.out " Append it to the output file
|
||||
:set shelltemp " need temp files here
|
||||
:au FilterReadPre *.out call rename(expand("<afile>"), expand("<afile>") . ".t")
|
||||
:au FilterReadPre *.out exe '!sed s/e/E/ ' . shellescape(expand("<afile>")) . ".t >" . shellescape(expand("<afile>"))
|
||||
:au FilterReadPre *.out exe '!rm ' . shellescape(expand("<afile>")) . '.t'
|
||||
:au FilterReadPost *.out '[,']s/x/X/g
|
||||
:e! test.out " Edit the output file
|
||||
:23,$!cat
|
||||
:23,$s/\r$// " remove CR for when sed adds them
|
||||
:au! FileReadPre *.gz exe '!gzip -d ' . shellescape(expand("<afile>"))
|
||||
:au FileReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
|
||||
:au! FileReadPost *.gz '[,']s/l/L/
|
||||
:$r Xtestfile.gz " Read compressed file
|
||||
:w " write it, after filtering
|
||||
:au! " remove all autocommands
|
||||
:e " Edit test.out again
|
||||
:set nobin ff& " use the default fileformat for writing
|
||||
:w
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
startstart
|
||||
start of testfile
|
||||
line 2 Abcdefghijklmnopqrstuvwxyz
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 4 Abcdefghijklmnopqrstuvwxyz
|
||||
line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 6 Abcdefghijklmnopqrstuvwxyz
|
||||
line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 8 Abcdefghijklmnopqrstuvwxyz
|
||||
line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 10 Abcdefghijklmnopqrstuvwxyz
|
||||
end of testfile
|
||||
|
||||
start of test.c
|
||||
/*
|
||||
* Here is a new .c file
|
||||
*/
|
||||
end of test.c
|
||||
61
src/nvim/testdir/test11.ok
Normal file
61
src/nvim/testdir/test11.ok
Normal file
@@ -0,0 +1,61 @@
|
||||
startstart
|
||||
start of testfile
|
||||
line 2 Abcdefghijklmnopqrstuvwxyz
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 4 Abcdefghijklmnopqrstuvwxyz
|
||||
line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 6 Abcdefghijklmnopqrstuvwxyz
|
||||
line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 8 Abcdefghijklmnopqrstuvwxyz
|
||||
line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 10 Abcdefghijklmnopqrstuvwxyz
|
||||
end of testfile
|
||||
|
||||
start of test.c
|
||||
/*
|
||||
* Here is a new .c file
|
||||
*/
|
||||
end of test.c
|
||||
start of testfile
|
||||
line 2 Abcdefghijklmnopqrstuvwxyz
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
line 4 Abcdefghijklmnopqrstuvwxyz
|
||||
linE 5 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 6 AbcdefghijklmnopqrstuvwXyz
|
||||
linE 7 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 8 AbcdefghijklmnopqrstuvwXyz
|
||||
linE 9 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 10 AbcdefghijklmnopqrstuvwXyz
|
||||
End of testfile
|
||||
|
||||
/*
|
||||
* HEre is a NEW .c file
|
||||
*/
|
||||
/*
|
||||
* HEre is a new .c file
|
||||
*/
|
||||
start of tEstfile
|
||||
linE 2 AbcdefghijklmnopqrstuvwXyz
|
||||
linE 3 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 4 AbcdefghijklmnopqrstuvwXyz
|
||||
linE 5 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 6 AbcdefghijklmnopqrstuvwXyz
|
||||
linE 7 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 8 AbcdefghijklmnopqrstuvwXyz
|
||||
linE 9 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
linE 10 AbcdefghijklmnopqrstuvwXyz
|
||||
End of testfile
|
||||
/*
|
||||
* HEre is a new .c file
|
||||
*/
|
||||
start of testfiLe
|
||||
Line 2 Abcdefghijklmnopqrstuvwxyz
|
||||
Line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
Line 4 Abcdefghijklmnopqrstuvwxyz
|
||||
Line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
Line 6 Abcdefghijklmnopqrstuvwxyz
|
||||
Line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
Line 8 Abcdefghijklmnopqrstuvwxyz
|
||||
Line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
Line 10 Abcdefghijklmnopqrstuvwxyz
|
||||
end of testfiLe
|
||||
52
src/nvim/testdir/test12.in
Normal file
52
src/nvim/testdir/test12.in
Normal file
@@ -0,0 +1,52 @@
|
||||
Tests for 'directory' option.
|
||||
- ".", in same dir as file
|
||||
- "./dir", in directory relative to file
|
||||
- "dir", in directory relative to current dir
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocompatible viminfo+=nviminfo
|
||||
:set dir=.,~
|
||||
:/start of testfile/,/end of testfile/w! Xtest1
|
||||
:" do an ls of the current dir to find the swap file (should not be there)
|
||||
:if has("unix")
|
||||
: !ls .X*.swp >test.out
|
||||
:else
|
||||
: r !ls X*.swp >test.out
|
||||
:endif
|
||||
:!echo first line >>test.out
|
||||
:e Xtest1
|
||||
:if has("unix")
|
||||
:" Do an ls of the current dir to find the swap file, remove the leading dot
|
||||
:" to make the result the same for all systems.
|
||||
: r!ls .X*.swp
|
||||
: s/\.*X/X/
|
||||
: .w >>test.out
|
||||
: undo
|
||||
:else
|
||||
: !ls X*.swp >>test.out
|
||||
:endif
|
||||
:!echo under Xtest1.swp >>test.out
|
||||
:!mkdir Xtest2
|
||||
:set dir=./Xtest2,.,~
|
||||
:e Xtest1
|
||||
:!ls X*.swp >>test.out
|
||||
:!echo under under >>test.out
|
||||
:!ls Xtest2 >>test.out
|
||||
:!echo under Xtest1.swp >>test.out
|
||||
:!mkdir Xtest.je
|
||||
:/start of testfile/,/end of testfile/w! Xtest2/Xtest3
|
||||
:set dir=Xtest.je,~
|
||||
:e Xtest2/Xtest3
|
||||
:swap
|
||||
:!ls Xtest2 >>test.out
|
||||
:!echo under Xtest3 >>test.out
|
||||
:!ls Xtest.je >>test.out
|
||||
:!echo under Xtest3.swp >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of testfile
|
||||
line 2 Abcdefghij
|
||||
line 3 Abcdefghij
|
||||
end of testfile
|
||||
10
src/nvim/testdir/test12.ok
Normal file
10
src/nvim/testdir/test12.ok
Normal file
@@ -0,0 +1,10 @@
|
||||
first line
|
||||
Xtest1.swp
|
||||
under Xtest1.swp
|
||||
under under
|
||||
Xtest1.swp
|
||||
under Xtest1.swp
|
||||
Xtest3
|
||||
under Xtest3
|
||||
Xtest3.swp
|
||||
under Xtest3.swp
|
||||
58
src/nvim/testdir/test13.in
Normal file
58
src/nvim/testdir/test13.in
Normal file
@@ -0,0 +1,58 @@
|
||||
Tests for autocommands on :close command
|
||||
|
||||
Write three files and open them, each in a window.
|
||||
Then go to next window, with autocommand that deletes the previous one.
|
||||
Do this twice, writing the file.
|
||||
|
||||
Also test deleting the buffer on a Unload event. If this goes wrong there
|
||||
will be the ATTENTION prompt.
|
||||
|
||||
Also test changing buffers in a BufDel autocommand. If this goes wrong there
|
||||
are ml_line errors and/or a Crash.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:/^start of testfile/,/^end of testfile/w! Xtestje1
|
||||
:/^start of testfile/,/^end of testfile/w! Xtestje2
|
||||
:/^start of testfile/,/^end of testfile/w! Xtestje3
|
||||
:e Xtestje1
|
||||
otestje1
|
||||
:w
|
||||
:sp Xtestje2
|
||||
otestje2
|
||||
:w
|
||||
:sp Xtestje3
|
||||
otestje3
|
||||
:w
|
||||
|
||||
:au WinLeave Xtestje2 bwipe
|
||||
|
||||
:w! test.out
|
||||
:au WinLeave Xtestje1 bwipe Xtestje3
|
||||
:close
|
||||
:w >>test.out
|
||||
:e Xtestje1
|
||||
:bwipe Xtestje2 Xtestje3 test.out
|
||||
:au!
|
||||
:au! BufUnload Xtestje1 bwipe
|
||||
:e Xtestje3
|
||||
:w >>test.out
|
||||
:e Xtestje2
|
||||
:sp Xtestje1
|
||||
:e
|
||||
:w >>test.out
|
||||
:au!
|
||||
:only
|
||||
:e Xtestje1
|
||||
:bwipe Xtestje2 Xtestje3 test.out test13.in
|
||||
:au BufWipeout Xtestje1 buf Xtestje1
|
||||
:bwipe
|
||||
:w >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of testfile
|
||||
contents
|
||||
contents
|
||||
contents
|
||||
end of testfile
|
||||
30
src/nvim/testdir/test13.ok
Normal file
30
src/nvim/testdir/test13.ok
Normal file
@@ -0,0 +1,30 @@
|
||||
start of testfile
|
||||
testje1
|
||||
contents
|
||||
contents
|
||||
contents
|
||||
end of testfile
|
||||
start of testfile
|
||||
testje1
|
||||
contents
|
||||
contents
|
||||
contents
|
||||
end of testfile
|
||||
start of testfile
|
||||
testje3
|
||||
contents
|
||||
contents
|
||||
contents
|
||||
end of testfile
|
||||
start of testfile
|
||||
testje2
|
||||
contents
|
||||
contents
|
||||
contents
|
||||
end of testfile
|
||||
start of testfile
|
||||
testje1
|
||||
contents
|
||||
contents
|
||||
contents
|
||||
end of testfile
|
||||
99
src/nvim/testdir/test14.in
Normal file
99
src/nvim/testdir/test14.in
Normal file
@@ -0,0 +1,99 @@
|
||||
Tests for "vaBiB", end could be wrong.
|
||||
Also test ":s/pat/sub/" with different ~s in sub.
|
||||
Also test for ^Vxff and ^Vo123 in Insert mode.
|
||||
Also test "[m", "]m", "[M" and "]M"
|
||||
Also test search()
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
/Start cursor here
|
||||
vaBiBD:?Bug?,/Piece/-2w! test.out
|
||||
/^- Bug
|
||||
:s/u/~u~/
|
||||
:s/i/~u~/
|
||||
:s/o/~~~/
|
||||
:.w >>test.out
|
||||
:if has("ebcdic")
|
||||
: let tt = "o\<C-V>193\<C-V>xc2\<C-V>o303 \<C-V>90a\<C-V>xfg\<C-V>o578\<Esc>"
|
||||
:else
|
||||
: let tt = "o\<C-V>65\<C-V>x42\<C-V>o103 \<C-V>33a\<C-V>xfg\<C-V>o78\<Esc>"
|
||||
:endif
|
||||
:exe "normal " . tt
|
||||
:unlet tt
|
||||
:.w >>test.out
|
||||
:set vb
|
||||
/^Piece
|
||||
2]maA:.w >>test.out
|
||||
j]maB:.w >>test.out
|
||||
]maC:.w >>test.out
|
||||
[maD:.w >>test.out
|
||||
k2[maE:.w >>test.out
|
||||
3[maF:.w >>test.out
|
||||
]MaG:.w >>test.out
|
||||
j2]MaH:.w >>test.out
|
||||
]M]MaI:.w >>test.out
|
||||
2[MaJ:.w >>test.out
|
||||
k[MaK:.w >>test.out
|
||||
3[MaL:.w >>test.out
|
||||
:"
|
||||
/^foobar
|
||||
:let startline = line('.')
|
||||
:call search('foobar', 'c')
|
||||
:call append(line('$'), line('.') - startline)
|
||||
j:call search('^$', 'c')
|
||||
:call append(line('$'), line('.') - startline)
|
||||
:call search('^$', 'bc')
|
||||
:call append(line('$'), line('.') - startline)
|
||||
/two
|
||||
:call search('.', 'c')
|
||||
:call append(line('$'), getline('.')[col('.') - 1:])
|
||||
:"
|
||||
/^substitute
|
||||
:s/foo/bar/
|
||||
:$put =@/
|
||||
/^substitute
|
||||
:keeppatterns s/asdf/xyz/
|
||||
:$put =@/
|
||||
/^substitute
|
||||
Y:$put =@0
|
||||
/bar /e
|
||||
:$put =@0
|
||||
-:keeppatterns /xyz
|
||||
0dn:/^search()/,$w >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
- Bug in "vPPPP" on this text (Webb):
|
||||
{
|
||||
cmd;
|
||||
{
|
||||
cmd; /* <-- Start cursor here */
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Piece of Java
|
||||
{
|
||||
tt m1 {
|
||||
t1;
|
||||
} e1
|
||||
|
||||
tt m2 {
|
||||
t2;
|
||||
} e2
|
||||
|
||||
tt m3 {
|
||||
if (x)
|
||||
{
|
||||
t3;
|
||||
}
|
||||
} e3
|
||||
}
|
||||
|
||||
foobar
|
||||
|
||||
substitute foo asdf
|
||||
|
||||
one two
|
||||
search()
|
||||
26
src/nvim/testdir/test14.ok
Normal file
26
src/nvim/testdir/test14.ok
Normal file
@@ -0,0 +1,26 @@
|
||||
- Bug in "vPPPP" on this text (Webb):
|
||||
{
|
||||
}
|
||||
- Bug uuun "vPPPP" uuuuuuuuun this text (Webb):
|
||||
ABC !ag8
|
||||
tt m1 {A
|
||||
tt m2 {B
|
||||
tt m3 {C
|
||||
tt m3 {DC
|
||||
tt m1 {EA
|
||||
{F
|
||||
}G e1
|
||||
}H e3
|
||||
}I
|
||||
}JH e3
|
||||
}K e2
|
||||
{LF
|
||||
search()
|
||||
0
|
||||
1
|
||||
1
|
||||
two
|
||||
foo
|
||||
^substitute
|
||||
substitute bar xyz
|
||||
xyz
|
||||
136
src/nvim/testdir/test15.in
Normal file
136
src/nvim/testdir/test15.in
Normal file
@@ -0,0 +1,136 @@
|
||||
Tests for :right on text with embedded TAB.
|
||||
Also test formatting a paragraph.
|
||||
Also test undo after ":%s" and formatting.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set tw=65
|
||||
|
||||
:/^\s*test for :left/,/^\s*test for :center/ left
|
||||
:/^\s*test for :center/,/^\s*test for :right/ center
|
||||
:/^\s*test for :right/,/^xxx/-1 right
|
||||
:set fo+=tcroql tw=72
|
||||
/xxxxxxxx$
|
||||
0gq6kk
|
||||
:set nocp viminfo+=nviminfo
|
||||
:" undo/redo here to make the next undo only work on the following changes
|
||||
u
|
||||
:map gg :.,.+2s/^/x/<CR>kk:set tw=3<CR>gqq
|
||||
/^aa
|
||||
ggu
|
||||
:?test for :left?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
test for :left
|
||||
a a
|
||||
fa a
|
||||
dfa a
|
||||
sdfa a
|
||||
asdfa a
|
||||
xasdfa a
|
||||
asxxdfa a
|
||||
|
||||
test for :center
|
||||
a a
|
||||
fa afd asdf
|
||||
dfa a
|
||||
sdfa afd asdf
|
||||
asdfa a
|
||||
xasdfa asdfasdfasdfasdfasdf
|
||||
asxxdfa a
|
||||
|
||||
test for :right
|
||||
a a
|
||||
fa a
|
||||
dfa a
|
||||
sdfa a
|
||||
asdfa a
|
||||
xasdfa a
|
||||
asxxdfa a
|
||||
asxa;ofa a
|
||||
asdfaqwer a
|
||||
a ax
|
||||
fa ax
|
||||
dfa ax
|
||||
sdfa ax
|
||||
asdfa ax
|
||||
xasdfa ax
|
||||
asxxdfa ax
|
||||
asxa;ofa ax
|
||||
asdfaqwer ax
|
||||
a axx
|
||||
fa axx
|
||||
dfa axx
|
||||
sdfa axx
|
||||
asdfa axx
|
||||
xasdfa axx
|
||||
asxxdfa axx
|
||||
asxa;ofa axx
|
||||
asdfaqwer axx
|
||||
a axxx
|
||||
fa axxx
|
||||
dfa axxx
|
||||
sdfa axxx
|
||||
asdfa axxx
|
||||
xasdfa axxx
|
||||
asxxdfa axxx
|
||||
asxa;ofa axxx
|
||||
asdfaqwer axxx
|
||||
a axxxo
|
||||
fa axxxo
|
||||
dfa axxxo
|
||||
sdfa axxxo
|
||||
asdfa axxxo
|
||||
xasdfa axxxo
|
||||
asxxdfa axxxo
|
||||
asxa;ofa axxxo
|
||||
asdfaqwer axxxo
|
||||
a axxxoi
|
||||
fa axxxoi
|
||||
dfa axxxoi
|
||||
sdfa axxxoi
|
||||
asdfa axxxoi
|
||||
xasdfa axxxoi
|
||||
asxxdfa axxxoi
|
||||
asxa;ofa axxxoi
|
||||
asdfaqwer axxxoi
|
||||
a axxxoik
|
||||
fa axxxoik
|
||||
dfa axxxoik
|
||||
sdfa axxxoik
|
||||
asdfa axxxoik
|
||||
xasdfa axxxoik
|
||||
asxxdfa axxxoik
|
||||
asxa;ofa axxxoik
|
||||
asdfaqwer axxxoik
|
||||
a axxxoike
|
||||
fa axxxoike
|
||||
dfa axxxoike
|
||||
sdfa axxxoike
|
||||
asdfa axxxoike
|
||||
xasdfa axxxoike
|
||||
asxxdfa axxxoike
|
||||
asxa;ofa axxxoike
|
||||
asdfaqwer axxxoike
|
||||
a axxxoikey
|
||||
fa axxxoikey
|
||||
dfa axxxoikey
|
||||
sdfa axxxoikey
|
||||
asdfa axxxoikey
|
||||
xasdfa axxxoikey
|
||||
asxxdfa axxxoikey
|
||||
asxa;ofa axxxoikey
|
||||
asdfaqwer axxxoikey
|
||||
|
||||
xxxxx xx xxxxxx
|
||||
xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx
|
||||
xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx
|
||||
xx xxxxxxx. xxxx xxxx.
|
||||
|
||||
> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx
|
||||
> xxxxxx xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx
|
||||
|
||||
aa aa aa aa
|
||||
bb bb bb bb
|
||||
cc cc cc cc
|
||||
111
src/nvim/testdir/test15.ok
Normal file
111
src/nvim/testdir/test15.ok
Normal file
@@ -0,0 +1,111 @@
|
||||
test for :left
|
||||
a a
|
||||
fa a
|
||||
dfa a
|
||||
sdfa a
|
||||
asdfa a
|
||||
xasdfa a
|
||||
asxxdfa a
|
||||
|
||||
test for :center
|
||||
a a
|
||||
fa afd asdf
|
||||
dfa a
|
||||
sdfa afd asdf
|
||||
asdfa a
|
||||
xasdfa asdfasdfasdfasdfasdf
|
||||
asxxdfa a
|
||||
|
||||
test for :right
|
||||
a a
|
||||
fa a
|
||||
dfa a
|
||||
sdfa a
|
||||
asdfa a
|
||||
xasdfa a
|
||||
asxxdfa a
|
||||
asxa;ofa a
|
||||
asdfaqwer a
|
||||
a ax
|
||||
fa ax
|
||||
dfa ax
|
||||
sdfa ax
|
||||
asdfa ax
|
||||
xasdfa ax
|
||||
asxxdfa ax
|
||||
asxa;ofa ax
|
||||
asdfaqwer ax
|
||||
a axx
|
||||
fa axx
|
||||
dfa axx
|
||||
sdfa axx
|
||||
asdfa axx
|
||||
xasdfa axx
|
||||
asxxdfa axx
|
||||
asxa;ofa axx
|
||||
asdfaqwer axx
|
||||
a axxx
|
||||
fa axxx
|
||||
dfa axxx
|
||||
sdfa axxx
|
||||
asdfa axxx
|
||||
xasdfa axxx
|
||||
asxxdfa axxx
|
||||
asxa;ofa axxx
|
||||
asdfaqwer axxx
|
||||
a axxxo
|
||||
fa axxxo
|
||||
dfa axxxo
|
||||
sdfa axxxo
|
||||
asdfa axxxo
|
||||
xasdfa axxxo
|
||||
asxxdfa axxxo
|
||||
asxa;ofa axxxo
|
||||
asdfaqwer axxxo
|
||||
a axxxoi
|
||||
fa axxxoi
|
||||
dfa axxxoi
|
||||
sdfa axxxoi
|
||||
asdfa axxxoi
|
||||
xasdfa axxxoi
|
||||
asxxdfa axxxoi
|
||||
asxa;ofa axxxoi
|
||||
asdfaqwer axxxoi
|
||||
a axxxoik
|
||||
fa axxxoik
|
||||
dfa axxxoik
|
||||
sdfa axxxoik
|
||||
asdfa axxxoik
|
||||
xasdfa axxxoik
|
||||
asxxdfa axxxoik
|
||||
asxa;ofa axxxoik
|
||||
asdfaqwer axxxoik
|
||||
a axxxoike
|
||||
fa axxxoike
|
||||
dfa axxxoike
|
||||
sdfa axxxoike
|
||||
asdfa axxxoike
|
||||
xasdfa axxxoike
|
||||
asxxdfa axxxoike
|
||||
asxa;ofa axxxoike
|
||||
asdfaqwer axxxoike
|
||||
a axxxoikey
|
||||
fa axxxoikey
|
||||
dfa axxxoikey
|
||||
sdfa axxxoikey
|
||||
asdfa axxxoikey
|
||||
xasdfa axxxoikey
|
||||
asxxdfa axxxoikey
|
||||
asxa;ofa axxxoikey
|
||||
asdfaqwer axxxoikey
|
||||
|
||||
xxxxx xx xxxxxx xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx
|
||||
xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx xx xxxxxxx.
|
||||
xxxx xxxx.
|
||||
|
||||
> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxx
|
||||
> xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx
|
||||
|
||||
aa aa aa aa
|
||||
bb bb bb bb
|
||||
cc cc cc cc
|
||||
15
src/nvim/testdir/test16.in
Normal file
15
src/nvim/testdir/test16.in
Normal file
@@ -0,0 +1,15 @@
|
||||
Tests for resetting "secure" flag after GUI has started.
|
||||
For KDE set a font, empty 'guifont' may cause a hang.
|
||||
|
||||
STARTTEST
|
||||
:if $DISPLAY == "" | e! test.ok | wq! test.out | endif
|
||||
:set exrc secure
|
||||
:if has("gui_kde")
|
||||
: set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0
|
||||
:endif
|
||||
:gui -f
|
||||
:.,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
just some text
|
||||
2
src/nvim/testdir/test16.ok
Normal file
2
src/nvim/testdir/test16.ok
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
just some text
|
||||
141
src/nvim/testdir/test17.in
Normal file
141
src/nvim/testdir/test17.in
Normal file
@@ -0,0 +1,141 @@
|
||||
Tests for:
|
||||
- "gf" on ${VAR},
|
||||
- ":checkpath!" with various 'include' settings.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:if has("ebcdic")
|
||||
: set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,}
|
||||
:else
|
||||
: set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
|
||||
:endif
|
||||
:function! DeleteDirectory(dir)
|
||||
: if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32")
|
||||
: exec "silent !rmdir /Q /S " . a:dir
|
||||
: else
|
||||
: exec "silent !rm -rf " . a:dir
|
||||
: endif
|
||||
:endfun
|
||||
:if has("unix")
|
||||
:let $CDIR = "."
|
||||
/CDIR
|
||||
:else
|
||||
:if has("amiga")
|
||||
:let $TDIR = "/testdir"
|
||||
:else
|
||||
:let $TDIR = "."
|
||||
:endif
|
||||
/TDIR
|
||||
:endif
|
||||
:" Dummy writing for making that sure gf doesn't fail even if the current
|
||||
:" file is modified. It can be occurred when executing the following command
|
||||
:" directly on Windows without fixing the 'fileformat':
|
||||
:" > nmake -f Make_dos.mak test17.out
|
||||
:w! test.out
|
||||
gf
|
||||
:set ff=unix
|
||||
:w! test.out
|
||||
:brewind
|
||||
ENDTEST
|
||||
|
||||
${CDIR}/test17a.in
|
||||
$TDIR/test17a.in
|
||||
|
||||
STARTTEST
|
||||
:" check for 'include' without \zs or \ze
|
||||
:lang C
|
||||
:call delete("./Xbase.a")
|
||||
:call DeleteDirectory("Xdir1")
|
||||
:!mkdir Xdir1
|
||||
:!mkdir "Xdir1/dir2"
|
||||
:e! Xdir1/dir2/foo.a
|
||||
i#include "bar.a"
|
||||
:w
|
||||
:e Xdir1/dir2/bar.a
|
||||
i#include "baz.a"
|
||||
:w
|
||||
:e Xdir1/dir2/baz.a
|
||||
i#include "foo.a"
|
||||
:w
|
||||
:e Xbase.a
|
||||
:set path=Xdir1/dir2
|
||||
i#include <foo.a>
|
||||
:w
|
||||
:redir! >>test.out
|
||||
:checkpath!
|
||||
:redir END
|
||||
:brewind
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:" check for 'include' with \zs and \ze
|
||||
:call delete("./Xbase.b")
|
||||
:call DeleteDirectory("Xdir1")
|
||||
:!mkdir Xdir1
|
||||
:!mkdir "Xdir1/dir2"
|
||||
:let &include='^\s*%inc\s*/\zs[^/]\+\ze'
|
||||
:function! DotsToSlashes()
|
||||
: return substitute(v:fname, '\.', '/', 'g') . '.b'
|
||||
:endfunction
|
||||
:let &includeexpr='DotsToSlashes()'
|
||||
:e! Xdir1/dir2/foo.b
|
||||
i%inc /bar/
|
||||
:w
|
||||
:e Xdir1/dir2/bar.b
|
||||
i%inc /baz/
|
||||
:w
|
||||
:e Xdir1/dir2/baz.b
|
||||
i%inc /foo/
|
||||
:w
|
||||
:e Xbase.b
|
||||
:set path=Xdir1/dir2
|
||||
i%inc /foo/
|
||||
:w
|
||||
:redir! >>test.out
|
||||
:checkpath!
|
||||
:redir END
|
||||
:brewind
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:" check for 'include' with \zs and no \ze
|
||||
:call delete("./Xbase.c")
|
||||
:call DeleteDirectory("Xdir1")
|
||||
:!mkdir Xdir1
|
||||
:!mkdir "Xdir1/dir2"
|
||||
:let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze'
|
||||
:function! StripNewlineChar()
|
||||
: if v:fname =~ '\n$'
|
||||
: return v:fname[:-2]
|
||||
: endif
|
||||
: return v:fname
|
||||
:endfunction
|
||||
:let &includeexpr='StripNewlineChar()'
|
||||
:e! Xdir1/dir2/foo.c
|
||||
i%inc bar.c
|
||||
:w
|
||||
:e Xdir1/dir2/bar.c
|
||||
i%inc baz.c
|
||||
:w
|
||||
:e Xdir1/dir2/baz.c
|
||||
i%inc foo.c
|
||||
:w
|
||||
:e Xdir1/dir2/FALSE.c
|
||||
i%inc foo.c
|
||||
:w
|
||||
:e Xbase.c
|
||||
:set path=Xdir1/dir2
|
||||
i%inc FALSE.c foo.c
|
||||
:w
|
||||
:redir! >>test.out
|
||||
:checkpath!
|
||||
:redir END
|
||||
:brewind
|
||||
:" change "\" to "/" for Windows and fix 'fileformat'
|
||||
:e test.out
|
||||
:%s#\\#/#g
|
||||
:set ff&
|
||||
:w
|
||||
:q
|
||||
ENDTEST
|
||||
|
||||
33
src/nvim/testdir/test17.ok
Normal file
33
src/nvim/testdir/test17.ok
Normal file
@@ -0,0 +1,33 @@
|
||||
This file is just to test "gf" in test 17.
|
||||
The contents is not important.
|
||||
Just testing!
|
||||
|
||||
|
||||
--- Included files in path ---
|
||||
Xdir1/dir2/foo.a
|
||||
Xdir1/dir2/foo.a -->
|
||||
Xdir1/dir2/bar.a
|
||||
Xdir1/dir2/bar.a -->
|
||||
Xdir1/dir2/baz.a
|
||||
Xdir1/dir2/baz.a -->
|
||||
"foo.a" (Already listed)
|
||||
|
||||
|
||||
--- Included files in path ---
|
||||
Xdir1/dir2/foo.b
|
||||
Xdir1/dir2/foo.b -->
|
||||
Xdir1/dir2/bar.b
|
||||
Xdir1/dir2/bar.b -->
|
||||
Xdir1/dir2/baz.b
|
||||
Xdir1/dir2/baz.b -->
|
||||
foo (Already listed)
|
||||
|
||||
|
||||
--- Included files in path ---
|
||||
Xdir1/dir2/foo.c
|
||||
Xdir1/dir2/foo.c -->
|
||||
Xdir1/dir2/bar.c
|
||||
Xdir1/dir2/bar.c -->
|
||||
Xdir1/dir2/baz.c
|
||||
Xdir1/dir2/baz.c -->
|
||||
foo.c (Already listed)
|
||||
3
src/nvim/testdir/test17a.in
Normal file
3
src/nvim/testdir/test17a.in
Normal file
@@ -0,0 +1,3 @@
|
||||
This file is just to test "gf" in test 17.
|
||||
The contents is not important.
|
||||
Just testing!
|
||||
16
src/nvim/testdir/test18.in
Normal file
16
src/nvim/testdir/test18.in
Normal file
@@ -0,0 +1,16 @@
|
||||
Tests for not doing smart indenting when it isn't set.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocin nosi ai
|
||||
/some
|
||||
2cc#test
|
||||
:?start?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start text
|
||||
some test text
|
||||
test text
|
||||
test text
|
||||
test text
|
||||
4
src/nvim/testdir/test18.ok
Normal file
4
src/nvim/testdir/test18.ok
Normal file
@@ -0,0 +1,4 @@
|
||||
start text
|
||||
#test
|
||||
test text
|
||||
test text
|
||||
33
src/nvim/testdir/test19.in
Normal file
33
src/nvim/testdir/test19.in
Normal file
@@ -0,0 +1,33 @@
|
||||
Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
|
||||
Also test that dv_ works correctly
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set smarttab expandtab ts=8 sw=4
|
||||
:" make sure that backspace works, no matter what termcap is used
|
||||
:set t_kD=x7f t_kb=x08
|
||||
/some
|
||||
r :set noexpandtab
|
||||
/other
|
||||
r
|
||||
:" Test replacing with Tabs and then backspacing to undo it
|
||||
0wR
|
||||
:" Test replacing with Tabs
|
||||
0wR
|
||||
:" Test that copyindent works with expandtab set
|
||||
:set expandtab smartindent copyindent ts=8 sw=8 sts=8
|
||||
o{
|
||||
x:set nosol
|
||||
/Second line/
|
||||
fwdv_:?^start?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start text
|
||||
some test text
|
||||
test text
|
||||
other test text
|
||||
a cde
|
||||
f ghi
|
||||
test text
|
||||
Second line beginning with whitespace
|
||||
10
src/nvim/testdir/test19.ok
Normal file
10
src/nvim/testdir/test19.ok
Normal file
@@ -0,0 +1,10 @@
|
||||
start text
|
||||
ome test text
|
||||
test text
|
||||
ther test text
|
||||
a cde
|
||||
hi
|
||||
test text
|
||||
{
|
||||
x
|
||||
with whitespace
|
||||
29
src/nvim/testdir/test2.in
Normal file
29
src/nvim/testdir/test2.in
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
This is a test if a URL is recognized by "gf", with the cursor before and
|
||||
after the "://". Also test ":\\".
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
/^first
|
||||
/tmp
|
||||
:call append(0, expand("<cfile>"))
|
||||
/^second
|
||||
/URL
|
||||
:call append(1, expand("<cfile>"))
|
||||
:if has("ebcdic")
|
||||
: set isf=@,240-249,/,.,-,_,+,,,$,:,~,\
|
||||
:else
|
||||
: set isf=@,48-57,/,.,-,_,+,,,$,:,~,\
|
||||
:endif
|
||||
/^third
|
||||
/name
|
||||
:call append(2, expand("<cfile>"))
|
||||
/^fourth
|
||||
/URL
|
||||
:call append(3, expand("<cfile>"))
|
||||
5GdG:wq! test.out
|
||||
ENDTEST
|
||||
first test for URL://machine.name/tmp/vimtest2a and other text
|
||||
second test for URL://machine.name/tmp/vimtest2b. And other text
|
||||
third test for URL:\\machine.name\vimtest2c and other text
|
||||
fourth test for URL:\\machine.name\tmp\vimtest2d, and other text
|
||||
4
src/nvim/testdir/test2.ok
Normal file
4
src/nvim/testdir/test2.ok
Normal file
@@ -0,0 +1,4 @@
|
||||
URL://machine.name/tmp/vimtest2a
|
||||
URL://machine.name/tmp/vimtest2b
|
||||
URL:\\machine.name\vimtest2c
|
||||
URL:\\machine.name\tmp\vimtest2d
|
||||
28
src/nvim/testdir/test20.in
Normal file
28
src/nvim/testdir/test20.in
Normal file
@@ -0,0 +1,28 @@
|
||||
Tests Blockwise Visual when there are TABs before the text.
|
||||
First test for undo working properly when executing commands from a register.
|
||||
Also test this in an empty buffer.
|
||||
|
||||
STARTTEST
|
||||
:so tiny.vim
|
||||
G0"ay$k@au
|
||||
:new
|
||||
@auY:quit!
|
||||
GP
|
||||
/start here$
|
||||
"by$jjlld
|
||||
/456$
|
||||
jj"bP
|
||||
:/56$/,$-1w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
123456
|
||||
234567
|
||||
345678
|
||||
|
||||
test text test tex start here
|
||||
some text
|
||||
test text
|
||||
test text
|
||||
|
||||
OxjAykdd
|
||||
10
src/nvim/testdir/test20.ok
Normal file
10
src/nvim/testdir/test20.ok
Normal file
@@ -0,0 +1,10 @@
|
||||
123start here56
|
||||
234start here67
|
||||
345start here78
|
||||
|
||||
test text test tex rt here
|
||||
somext
|
||||
tesext
|
||||
test text
|
||||
|
||||
|
||||
19
src/nvim/testdir/test21.in
Normal file
19
src/nvim/testdir/test21.in
Normal file
@@ -0,0 +1,19 @@
|
||||
Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
/start
|
||||
6[ :.w! test.out
|
||||
?start here
|
||||
6 :.w >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
#include test21.in
|
||||
|
||||
/* test text test tex start here
|
||||
some text
|
||||
test text
|
||||
start OK if found this line
|
||||
start found wrong line
|
||||
test text
|
||||
2
src/nvim/testdir/test21.ok
Normal file
2
src/nvim/testdir/test21.ok
Normal file
@@ -0,0 +1,2 @@
|
||||
start OK if found this line
|
||||
start OK if found this line
|
||||
13
src/nvim/testdir/test22.in
Normal file
13
src/nvim/testdir/test22.in
Normal file
@@ -0,0 +1,13 @@
|
||||
Tests for file with some lines ending in CTRL-M, some not
|
||||
|
||||
STARTTEST
|
||||
:set ta tx
|
||||
:e!
|
||||
:$-3,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
this lines ends in a
|
||||
this one doesn't
|
||||
this one does
|
||||
and the last one doesn't
|
||||
4
src/nvim/testdir/test22.ok
Normal file
4
src/nvim/testdir/test22.ok
Normal file
@@ -0,0 +1,4 @@
|
||||
this lines ends in a
|
||||
this one doesn't
|
||||
this one does
|
||||
and the last one doesn't
|
||||
15
src/nvim/testdir/test23.in
Normal file
15
src/nvim/testdir/test23.in
Normal file
@@ -0,0 +1,15 @@
|
||||
Tests for complicated + argument to :edit command
|
||||
|
||||
STARTTEST
|
||||
:$-1w! Xfile1
|
||||
:$w! Xfile2
|
||||
:edit +1|s/|/PIPE/|w Xfile1| e Xfile2|1 | s/\//SLASH/|w
|
||||
:w! test.out
|
||||
:e Xfile1
|
||||
:w >> test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
The result should be in Xfile1: "fooPIPEbar", in Xfile2: "fooSLASHbar"
|
||||
foo|bar
|
||||
foo/bar
|
||||
2
src/nvim/testdir/test23.ok
Normal file
2
src/nvim/testdir/test23.ok
Normal file
@@ -0,0 +1,2 @@
|
||||
fooSLASHbar
|
||||
fooPIPEbar
|
||||
BIN
src/nvim/testdir/test24.in
Normal file
BIN
src/nvim/testdir/test24.in
Normal file
Binary file not shown.
32
src/nvim/testdir/test24.ok
Normal file
32
src/nvim/testdir/test24.ok
Normal file
@@ -0,0 +1,32 @@
|
||||
start
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text x61
|
||||
test text test text x60-x64
|
||||
test text test text x78 5
|
||||
test text test text o143
|
||||
test text test text o140-o144
|
||||
test text test text o41 7
|
||||
test text test text \%x42
|
||||
test text test text \%o103
|
||||
test text test text [\x00]
|
||||
test text test text [\x00-\x10]
|
||||
test text test text [\x-z]
|
||||
test text test text [\u-z]
|
||||
xx xx a
|
||||
xx aaaaa xx a
|
||||
xx aaaaa xx a
|
||||
xx Aaa xx
|
||||
xx Aaaa xx
|
||||
xx Aaa xx
|
||||
xx foobar xA xx
|
||||
xx an A xx
|
||||
XX 9;
|
||||
YY 77;
|
||||
xyz
|
||||
bcd
|
||||
BB
|
||||
31
src/nvim/testdir/test25.in
Normal file
31
src/nvim/testdir/test25.in
Normal file
@@ -0,0 +1,31 @@
|
||||
Test for jumping to a tag with 'hidden' set, with symbolic link in path of tag.
|
||||
This only works for Unix, because of the symbolic link.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set hidden
|
||||
:" Create a link from test25.dir to the current directory.
|
||||
:!rm -f test25.dir
|
||||
:!ln -s . test25.dir
|
||||
:" Create tags.text, with the current directory name inserted.
|
||||
/tags line
|
||||
:r !pwd
|
||||
d$/test
|
||||
hP:.w! tags.test
|
||||
:" Try jumping to a tag in the current file, but with a path that contains a
|
||||
:" symbolic link. When wrong, this will give the ATTENTION message. The next
|
||||
:" space will then be eaten by hit-return, instead of moving the cursor to 'd'.
|
||||
:set tags=tags.test
|
||||
G x:.w! test.out
|
||||
:!rm -f test25.dir tags.test
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
tags line:
|
||||
SECTION_OFF /test25.dir/test25.in /^#define SECTION_OFF 3$/
|
||||
|
||||
/*tx.c*/
|
||||
#define SECTION_OFF 3
|
||||
#define NUM_SECTIONS 3
|
||||
|
||||
SECTION_OFF
|
||||
1
src/nvim/testdir/test25.ok
Normal file
1
src/nvim/testdir/test25.ok
Normal file
@@ -0,0 +1 @@
|
||||
#efine SECTION_OFF 3
|
||||
44
src/nvim/testdir/test26.in
Normal file
44
src/nvim/testdir/test26.in
Normal file
@@ -0,0 +1,44 @@
|
||||
Test for :execute, :while and :if
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
mt:let i = 0
|
||||
:while i < 12
|
||||
: let i = i + 1
|
||||
: if has("ebcdic")
|
||||
: execute "normal o" . i . "\047"
|
||||
: else
|
||||
: execute "normal o" . i . "\033"
|
||||
: endif
|
||||
: if i % 2
|
||||
: normal Ax
|
||||
: if i == 9
|
||||
: break
|
||||
: endif
|
||||
: if i == 5
|
||||
: continue
|
||||
: else
|
||||
: let j = 9
|
||||
: while j > 0
|
||||
: if has("ebcdic")
|
||||
: execute "normal" j . "a" . j . "\x27"
|
||||
: else
|
||||
: execute "normal" j . "a" . j . "\x1b"
|
||||
: endif
|
||||
: let j = j - 1
|
||||
: endwhile
|
||||
: endif
|
||||
: endif
|
||||
: if i == 9
|
||||
: if has("ebcdic")
|
||||
: execute "normal Az\047"
|
||||
: else
|
||||
: execute "normal Az\033"
|
||||
: endif
|
||||
: endif
|
||||
:endwhile
|
||||
:unlet i j
|
||||
:'t,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
10
src/nvim/testdir/test26.ok
Normal file
10
src/nvim/testdir/test26.ok
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
1x999999999888888887777777666666555554444333221
|
||||
2
|
||||
3x999999999888888887777777666666555554444333221
|
||||
4
|
||||
5x
|
||||
6
|
||||
7x999999999888888887777777666666555554444333221
|
||||
8
|
||||
9x
|
||||
20
src/nvim/testdir/test27.in
Normal file
20
src/nvim/testdir/test27.in
Normal file
@@ -0,0 +1,20 @@
|
||||
Test for expanding file names
|
||||
|
||||
STARTTEST
|
||||
:!mkdir Xdir1
|
||||
:!mkdir Xdir2
|
||||
:!mkdir Xdir3
|
||||
:cd Xdir3
|
||||
:!mkdir Xdir4
|
||||
:cd ..
|
||||
:w Xdir1/file
|
||||
:w Xdir3/Xdir4/file
|
||||
:n Xdir?/*/file
|
||||
Go%:.w! test.out
|
||||
:n! Xdir?/*/nofile
|
||||
Go%:.w >>test.out
|
||||
:e! xx
|
||||
:!rm -rf Xdir1 Xdir2 Xdir3
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
2
src/nvim/testdir/test27.ok
Normal file
2
src/nvim/testdir/test27.ok
Normal file
@@ -0,0 +1,2 @@
|
||||
Xdir3/Xdir4/file
|
||||
Xdir?/*/nofile
|
||||
BIN
src/nvim/testdir/test28.in
Normal file
BIN
src/nvim/testdir/test28.in
Normal file
Binary file not shown.
2
src/nvim/testdir/test28.ok
Normal file
2
src/nvim/testdir/test28.ok
Normal file
@@ -0,0 +1,2 @@
|
||||
sd
|
||||
map __2 asdsecondsdsd0map __5 asd0fifth
|
||||
230
src/nvim/testdir/test29.in
Normal file
230
src/nvim/testdir/test29.in
Normal file
@@ -0,0 +1,230 @@
|
||||
Test for joining lines and marks in them
|
||||
in compatible and nocompatible modes
|
||||
and with 'joinspaces' set or not
|
||||
and with 'cpoptions' flag 'j' set or not
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocompatible viminfo+=nviminfo
|
||||
:set nojoinspaces
|
||||
:set cpoptions-=j
|
||||
/firstline/
|
||||
j"td/^STARTTEST/-1
|
||||
PJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
|
||||
j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces
|
||||
j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
|
||||
j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible
|
||||
j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjd/STARTTEST/-2
|
||||
ENDTEST
|
||||
|
||||
firstline
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf.
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
asdfasdf
|
||||
asdf
|
||||
zx cvn.
|
||||
as dfg?
|
||||
hjkl iop!
|
||||
ert
|
||||
zx cvn.
|
||||
as dfg?
|
||||
hjkl iop!
|
||||
ert
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set comments=s1:/*,mb:*,ex:*/,://
|
||||
:set nojoinspaces fo=j
|
||||
:set backspace=eol,start
|
||||
:.,+3join
|
||||
j4J
|
||||
:.,+2join
|
||||
j3J
|
||||
:.,+2join
|
||||
j3J
|
||||
:.,+2join
|
||||
jj3J
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
|
||||
/*
|
||||
* Make sure the previous comment leader is not removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Make sure the previous comment leader is not removed.
|
||||
*/
|
||||
|
||||
// Should the next comment leader be left alone?
|
||||
// Yes.
|
||||
|
||||
// Should the next comment leader be left alone?
|
||||
// Yes.
|
||||
|
||||
/* Here the comment leader should be left intact. */
|
||||
// And so should this one.
|
||||
|
||||
/* Here the comment leader should be left intact. */
|
||||
// And so should this one.
|
||||
|
||||
if (condition) // Remove the next comment leader!
|
||||
// OK, I will.
|
||||
action();
|
||||
|
||||
if (condition) // Remove the next comment leader!
|
||||
// OK, I will.
|
||||
action();
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
:" Test with backspace set to the non-compatible setting
|
||||
/^\d\+ this
|
||||
:set cp bs=2
|
||||
Avim1
|
||||
Avim2u
|
||||
:set cpo-=<
|
||||
:inoremap <c-u> <left><c-u>
|
||||
Avim3
|
||||
:iunmap <c-u>
|
||||
Avim4
|
||||
:" Test with backspace set to the compatible setting
|
||||
:set bs=
|
||||
A vim5A
|
||||
A vim6Azweiu
|
||||
:inoremap <c-u> <left><c-u>
|
||||
A vim7
|
||||
:set cp
|
||||
ENDTEST
|
||||
1 this shouldn't be deleted
|
||||
2 this shouldn't be deleted
|
||||
3 this shouldn't be deleted
|
||||
4 this should be deleted
|
||||
5 this shouldn't be deleted
|
||||
6 this shouldn't be deleted
|
||||
7 this shouldn't be deleted
|
||||
8 this shouldn't be deleted (not touched yet)
|
||||
|
||||
STARTTEST
|
||||
/^{/+1
|
||||
:set comments=sO:*\ -,mO:*\ \ ,exO:*/
|
||||
:set comments+=s1:/*,mb:*,ex:*/,://
|
||||
:set comments+=s1:>#,mb:#,ex:#<,:<
|
||||
:set cpoptions-=j joinspaces fo=j
|
||||
:set backspace=eol,start
|
||||
:.,+3join
|
||||
j4J
|
||||
:.,+8join
|
||||
j9J
|
||||
:.,+2join
|
||||
j3J
|
||||
:.,+2join
|
||||
j3J
|
||||
:.,+2join
|
||||
jj3J
|
||||
j:.,+2join
|
||||
jj3J
|
||||
j:.,+5join
|
||||
j6J
|
||||
oSome code!
|
||||
// Make sure backspacing does not remove this comment leader.0i
|
||||
ENDTEST
|
||||
|
||||
{
|
||||
|
||||
/*
|
||||
* Make sure the previous comment leader is not removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Make sure the previous comment leader is not removed.
|
||||
*/
|
||||
|
||||
/* List:
|
||||
* - item1
|
||||
* foo bar baz
|
||||
* foo bar baz
|
||||
* - item2
|
||||
* foo bar baz
|
||||
* foo bar baz
|
||||
*/
|
||||
|
||||
/* List:
|
||||
* - item1
|
||||
* foo bar baz
|
||||
* foo bar baz
|
||||
* - item2
|
||||
* foo bar baz
|
||||
* foo bar baz
|
||||
*/
|
||||
|
||||
// Should the next comment leader be left alone?
|
||||
// Yes.
|
||||
|
||||
// Should the next comment leader be left alone?
|
||||
// Yes.
|
||||
|
||||
/* Here the comment leader should be left intact. */
|
||||
// And so should this one.
|
||||
|
||||
/* Here the comment leader should be left intact. */
|
||||
// And so should this one.
|
||||
|
||||
if (condition) // Remove the next comment leader!
|
||||
// OK, I will.
|
||||
action();
|
||||
|
||||
if (condition) // Remove the next comment leader!
|
||||
// OK, I will.
|
||||
action();
|
||||
|
||||
int i = 7 /* foo *// 3
|
||||
// comment
|
||||
;
|
||||
|
||||
int i = 7 /* foo *// 3
|
||||
// comment
|
||||
;
|
||||
|
||||
># Note that the last character of the ending comment leader (left angle
|
||||
# bracket) is a comment leader itself. Make sure that this comment leader is
|
||||
# not removed from the next line #<
|
||||
< On this line a new comment is opened which spans 2 lines. This comment should
|
||||
< retain its comment leader.
|
||||
|
||||
># Note that the last character of the ending comment leader (left angle
|
||||
# bracket) is a comment leader itself. Make sure that this comment leader is
|
||||
# not removed from the next line #<
|
||||
< On this line a new comment is opened which spans 2 lines. This comment should
|
||||
< retain its comment leader.
|
||||
|
||||
}
|
||||
|
||||
STARTTEST
|
||||
:g/^STARTTEST/.,/^ENDTEST/d
|
||||
:?firstline?+1,$w! test.out
|
||||
:qa!
|
||||
97
src/nvim/testdir/test29.ok
Normal file
97
src/nvim/testdir/test29.ok
Normal file
@@ -0,0 +1,97 @@
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
zx cvn. as dfg? hjkl iop! ert ernop
|
||||
zx cvn. as dfg? hjkl iop! ert ernop
|
||||
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
zx cvn. as dfg? hjkl iop! ert enop
|
||||
zx cvn. as dfg? hjkl iop! ert ernop
|
||||
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf. asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
asdfasdf asdf
|
||||
zx cvn. as dfg? hjkl iop! ert a
|
||||
|
||||
|
||||
{
|
||||
/* Make sure the previous comment leader is not removed. */
|
||||
/* Make sure the previous comment leader is not removed. */
|
||||
// Should the next comment leader be left alone? Yes.
|
||||
// Should the next comment leader be left alone? Yes.
|
||||
/* Here the comment leader should be left intact. */ // And so should this one.
|
||||
/* Here the comment leader should be left intact. */ // And so should this one.
|
||||
if (condition) // Remove the next comment leader! OK, I will.
|
||||
action();
|
||||
if (condition) // Remove the next comment leader! OK, I will.
|
||||
action();
|
||||
}
|
||||
|
||||
1 this shouldn't be deleted
|
||||
2 this shouldn't be deleted
|
||||
3 this shouldn't be deleted
|
||||
4 this should be deleted3
|
||||
|
||||
6 this shouldn't be deleted vim5
|
||||
7 this shouldn't be deleted vim6
|
||||
8 this shouldn't be deleted (not touched yet) vim7
|
||||
|
||||
|
||||
{
|
||||
/* Make sure the previous comment leader is not removed. */
|
||||
/* Make sure the previous comment leader is not removed. */
|
||||
/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
|
||||
/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
|
||||
// Should the next comment leader be left alone? Yes.
|
||||
// Should the next comment leader be left alone? Yes.
|
||||
/* Here the comment leader should be left intact. */ // And so should this one.
|
||||
/* Here the comment leader should be left intact. */ // And so should this one.
|
||||
if (condition) // Remove the next comment leader! OK, I will.
|
||||
action();
|
||||
if (condition) // Remove the next comment leader! OK, I will.
|
||||
action();
|
||||
int i = 7 /* foo *// 3 // comment
|
||||
;
|
||||
int i = 7 /* foo *// 3 // comment
|
||||
;
|
||||
># Note that the last character of the ending comment leader (left angle bracket) is a comment leader itself. Make sure that this comment leader is not removed from the next line #< < On this line a new comment is opened which spans 2 lines. This comment should retain its comment leader.
|
||||
># Note that the last character of the ending comment leader (left angle bracket) is a comment leader itself. Make sure that this comment leader is not removed from the next line #< < On this line a new comment is opened which spans 2 lines. This comment should retain its comment leader.
|
||||
|
||||
Some code!// Make sure backspacing does not remove this comment leader.
|
||||
}
|
||||
|
||||
2056
src/nvim/testdir/test3.in
Normal file
2056
src/nvim/testdir/test3.in
Normal file
File diff suppressed because it is too large
Load Diff
1820
src/nvim/testdir/test3.ok
Normal file
1820
src/nvim/testdir/test3.ok
Normal file
File diff suppressed because it is too large
Load Diff
222
src/nvim/testdir/test30.in
Normal file
222
src/nvim/testdir/test30.in
Normal file
@@ -0,0 +1,222 @@
|
||||
Test for a lot of variations of the 'fileformats' option
|
||||
|
||||
Note: This test will fail if "cat" is not available.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" first write three test files, one in each format
|
||||
:set fileformat=unix
|
||||
:set fileformats=
|
||||
:/^1/w! XX1
|
||||
:/^2/w! XX2
|
||||
:/^3/w! XX3
|
||||
:/^4/w! XX4
|
||||
:/^5/w! XX5
|
||||
:/^6/w! XX6
|
||||
:/^7/w! XX7
|
||||
:/^8/w! XX8
|
||||
:/^9/w! XX9
|
||||
:/^10/w! XX10
|
||||
:/^unix/;/eof/-1w! XXUnix
|
||||
:/^dos/;/eof/-1w! XXDos
|
||||
:set bin noeol
|
||||
:$w! XXMac
|
||||
:set nobin eol
|
||||
:bwipe XXUnix XXDos XXMac
|
||||
:" create mixed format files
|
||||
:if has("vms")
|
||||
: !copy XXUnix,XXDos XXUxDs.
|
||||
: !copy XXUnix,XXMac XXUxMac.
|
||||
: !copy XXDos,XXMac XXDosMac.
|
||||
: !copy XXUnix,XXDos,XXMac XXUxDsMc.
|
||||
:elseif has("win32")
|
||||
: !copy /b XXUnix+XXDos XXUxDs
|
||||
: !copy /b XXUnix+XXMac XXUxMac
|
||||
: !copy /b XXDos+XXMac XXDosMac
|
||||
: !copy /b XXUnix+XXDos+XXMac XXUxDsMc
|
||||
:else
|
||||
: !cat XXUnix XXDos >XXUxDs
|
||||
: !cat XXUnix XXMac >XXUxMac
|
||||
: !cat XXDos XXMac >XXDosMac
|
||||
: !cat XXUnix XXDos XXMac >XXUxDsMc
|
||||
:endif
|
||||
:"
|
||||
:" try reading and writing with 'fileformats' empty
|
||||
:set fileformat=unix
|
||||
:e! XXUnix
|
||||
:w! test.out
|
||||
:e! XXDos
|
||||
:w! XXtt01
|
||||
:e! XXMac
|
||||
:w! XXtt02
|
||||
:bwipe XXUnix XXDos XXMac
|
||||
:set fileformat=dos
|
||||
:e! XXUnix
|
||||
:w! XXtt11
|
||||
:e! XXDos
|
||||
:w! XXtt12
|
||||
:e! XXMac
|
||||
:w! XXtt13
|
||||
:bwipe XXUnix XXDos XXMac
|
||||
:set fileformat=mac
|
||||
:e! XXUnix
|
||||
:w! XXtt21
|
||||
:e! XXDos
|
||||
:w! XXtt22
|
||||
:e! XXMac
|
||||
:w! XXtt23
|
||||
:bwipe XXUnix XXDos XXMac
|
||||
:"
|
||||
:" try reading and writing with 'fileformats' set to one format
|
||||
:set fileformats=unix
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt31
|
||||
:bwipe XXUxDsMc
|
||||
:set fileformats=dos
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt32
|
||||
:bwipe XXUxDsMc
|
||||
:set fileformats=mac
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt33
|
||||
:bwipe XXUxDsMc
|
||||
:"
|
||||
:" try reading and writing with 'fileformats' set to two formats
|
||||
:set fileformats=unix,dos
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt41
|
||||
:bwipe XXUxDsMc
|
||||
:e! XXUxMac
|
||||
:w! XXtt42
|
||||
:bwipe XXUxMac
|
||||
:e! XXDosMac
|
||||
:w! XXtt43
|
||||
:bwipe XXDosMac
|
||||
:set fileformats=unix,mac
|
||||
:e! XXUxDs
|
||||
:w! XXtt51
|
||||
:bwipe XXUxDs
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt52
|
||||
:bwipe XXUxDsMc
|
||||
:e! XXDosMac
|
||||
:w! XXtt53
|
||||
:bwipe XXDosMac
|
||||
:set fileformats=dos,mac
|
||||
:e! XXUxDs
|
||||
:w! XXtt61
|
||||
:bwipe XXUxDs
|
||||
:e! XXUxMac
|
||||
:w! XXtt62
|
||||
:bwipe XXUxMac
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt63
|
||||
:bwipe XXUxDsMc
|
||||
:"
|
||||
:" try reading and writing with 'fileformats' set to three formats
|
||||
:set fileformats=unix,dos,mac
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt71
|
||||
:bwipe XXUxDsMc
|
||||
:set fileformats=mac,dos,unix
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt81
|
||||
:bwipe XXUxDsMc
|
||||
:" try with 'binary' set
|
||||
:set fileformats=mac,unix,dos
|
||||
:set binary
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt91
|
||||
:bwipe XXUxDsMc
|
||||
:set fileformats=mac
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt92
|
||||
:bwipe XXUxDsMc
|
||||
:set fileformats=dos
|
||||
:e! XXUxDsMc
|
||||
:w! XXtt93
|
||||
:"
|
||||
:" Append "END" to each file so that we can see what the last written char was.
|
||||
:set fileformat=unix nobin
|
||||
ggdGaEND:w >>XXtt01
|
||||
:w >>XXtt02
|
||||
:w >>XXtt11
|
||||
:w >>XXtt12
|
||||
:w >>XXtt13
|
||||
:w >>XXtt21
|
||||
:w >>XXtt22
|
||||
:w >>XXtt23
|
||||
:w >>XXtt31
|
||||
:w >>XXtt32
|
||||
:w >>XXtt33
|
||||
:w >>XXtt41
|
||||
:w >>XXtt42
|
||||
:w >>XXtt43
|
||||
:w >>XXtt51
|
||||
:w >>XXtt52
|
||||
:w >>XXtt53
|
||||
:w >>XXtt61
|
||||
:w >>XXtt62
|
||||
:w >>XXtt63
|
||||
:w >>XXtt71
|
||||
:w >>XXtt81
|
||||
:w >>XXtt91
|
||||
:w >>XXtt92
|
||||
:w >>XXtt93
|
||||
:"
|
||||
:" Concatenate the results.
|
||||
:" Make fileformat of test.out the native fileformat.
|
||||
:" Add a newline at the end.
|
||||
:set binary
|
||||
:e! test.out
|
||||
:$r XXtt01
|
||||
:$r XXtt02
|
||||
Go1:$r XXtt11
|
||||
:$r XXtt12
|
||||
:$r XXtt13
|
||||
Go2:$r XXtt21
|
||||
:$r XXtt22
|
||||
:$r XXtt23
|
||||
Go3:$r XXtt31
|
||||
:$r XXtt32
|
||||
:$r XXtt33
|
||||
Go4:$r XXtt41
|
||||
:$r XXtt42
|
||||
:$r XXtt43
|
||||
Go5:$r XXtt51
|
||||
:$r XXtt52
|
||||
:$r XXtt53
|
||||
Go6:$r XXtt61
|
||||
:$r XXtt62
|
||||
:$r XXtt63
|
||||
Go7:$r XXtt71
|
||||
Go8:$r XXtt81
|
||||
Go9:$r XXtt91
|
||||
:$r XXtt92
|
||||
:$r XXtt93
|
||||
Go10:$r XXUnix
|
||||
:set nobinary ff&
|
||||
:w
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
|
||||
unix
|
||||
unix
|
||||
eof
|
||||
|
||||
dos
|
||||
dos
|
||||
eof
|
||||
|
||||
mac
|
||||
121
src/nvim/testdir/test30.ok
Normal file
121
src/nvim/testdir/test30.ok
Normal file
@@ -0,0 +1,121 @@
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
END
|
||||
mac
|
||||
mac
|
||||
END
|
||||
1
|
||||
unix
|
||||
unix
|
||||
END
|
||||
dos
|
||||
dos
|
||||
END
|
||||
mac
|
||||
mac
|
||||
|
||||
END
|
||||
2
|
||||
unix
|
||||
unix
|
||||
|
||||
END
|
||||
dos
|
||||
dos
|
||||
|
||||
END
|
||||
mac
|
||||
mac
|
||||
END
|
||||
3
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
END
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
|
||||
END
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
END
|
||||
4
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
END
|
||||
unix
|
||||
unix
|
||||
mac
|
||||
mac
|
||||
END
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
|
||||
END
|
||||
5
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
END
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
END
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
END
|
||||
6
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
END
|
||||
unix
|
||||
unix
|
||||
mac
|
||||
mac
|
||||
|
||||
END
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
|
||||
END
|
||||
7
|
||||
unix
|
||||
unix
|
||||
dos
|
||||
dos
|
||||
mac
|
||||
mac
|
||||
END
|
||||
8
|
||||
unix
|
||||
75
src/nvim/testdir/test31.in
Normal file
75
src/nvim/testdir/test31.in
Normal file
@@ -0,0 +1,75 @@
|
||||
Test for commands that close windows and/or buffers:
|
||||
:quit
|
||||
:close
|
||||
:hide
|
||||
:only
|
||||
:sall
|
||||
:all
|
||||
:ball
|
||||
:buf
|
||||
:edit
|
||||
|
||||
STARTTEST
|
||||
:so tiny.vim
|
||||
GA 1:$w! Xtest1
|
||||
$r2:$w! Xtest2
|
||||
$r3:$w! Xtest3
|
||||
:n! Xtest1 Xtest2
|
||||
A 1:set hidden
|
||||
:" test for working :n when hidden set; write "testtext 2"
|
||||
:n
|
||||
:w! test.out
|
||||
:" test for failing :rew when hidden not set; write "testtext 2 2"
|
||||
:set nohidden
|
||||
A 2:rew
|
||||
:w >>test.out
|
||||
:" test for working :rew when hidden set; write "testtext 1 1"
|
||||
:set hidden
|
||||
:rew
|
||||
:w >>test.out
|
||||
:" test for :all keeping a buffer when it's modified; write "testtext 1 1 1"
|
||||
:set nohidden
|
||||
A 1:sp
|
||||
:n Xtest2 Xtest3
|
||||
:all
|
||||
:1wincmd w
|
||||
:w >>test.out
|
||||
:" test abandoning changed buffer, should be unloaded even when 'hidden' set
|
||||
:" write "testtext 2 2" twice
|
||||
:set hidden
|
||||
A 1:q!
|
||||
:w >>test.out
|
||||
:unhide
|
||||
:w >>test.out
|
||||
:" test ":hide" hides anyway when 'hidden' not set; write "testtext 3"
|
||||
:set nohidden
|
||||
A 2:hide
|
||||
:w >>test.out
|
||||
:" test ":edit" failing in modified buffer when 'hidden' not set
|
||||
:" write "testtext 3 3"
|
||||
A 3:e Xtest1
|
||||
:w >>test.out
|
||||
:" test ":edit" working in modified buffer when 'hidden' set; write "testtext 1"
|
||||
:set hidden
|
||||
:e Xtest1
|
||||
:w >>test.out
|
||||
:" test ":close" not hiding when 'hidden' not set in modified buffer;
|
||||
:" write "testtext 3 3 3"
|
||||
:sp Xtest3
|
||||
:set nohidden
|
||||
A 3:close
|
||||
:w >>test.out
|
||||
:" test ":close!" does hide when 'hidden' not set in modified buffer;
|
||||
:" write "testtext 1"
|
||||
A 3:close!
|
||||
:w >>test.out
|
||||
:set nohidden
|
||||
:" test ":all!" hides changed buffer; write "testtext 2 2 2"
|
||||
:sp Xtest4
|
||||
GA 4:all!
|
||||
:1wincmd w
|
||||
:w >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
testtext
|
||||
12
src/nvim/testdir/test31.ok
Normal file
12
src/nvim/testdir/test31.ok
Normal file
@@ -0,0 +1,12 @@
|
||||
testtext 2
|
||||
testtext 2 2
|
||||
testtext 1 1
|
||||
testtext 1 1 1
|
||||
testtext 2 2
|
||||
testtext 2 2
|
||||
testtext 3
|
||||
testtext 3 3
|
||||
testtext 1
|
||||
testtext 3 3 3
|
||||
testtext 1
|
||||
testtext 2 2 2
|
||||
60
src/nvim/testdir/test32.in
Normal file
60
src/nvim/testdir/test32.in
Normal file
@@ -0,0 +1,60 @@
|
||||
Test for insert expansion
|
||||
|
||||
:se cpt=.,w
|
||||
* add-expands (word from next line) from other window
|
||||
* add-expands (current buffer first)
|
||||
* Local expansion, ends in an empty line (unless it becomes a global expansion)
|
||||
* starts Local and switches to global add-expansion
|
||||
:se cpt=.,w,i
|
||||
* i-add-expands and switches to local
|
||||
* add-expands lines (it would end in an empty line if it didn't ignored it self)
|
||||
:se cpt=kXtestfile
|
||||
* checks k-expansion, and file expansion (use Xtest11 instead of test11,
|
||||
* because TEST11.OUT may match first on DOS)
|
||||
:se cpt=w
|
||||
* checks make_cyclic in other window
|
||||
:se cpt=u nohid
|
||||
* checks unloaded buffer expansion
|
||||
* checks adding mode abortion
|
||||
:se cpt=t,d
|
||||
* tag expansion, define add-expansion interrupted
|
||||
* t-expansion
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:se nocp viminfo+=nviminfo cpt=.,w ff=unix | $-2,$w!Xtestfile | set ff&
|
||||
:se cot=
|
||||
nO#include "Xtestfile"
|
||||
ru
|
||||
O
|
||||
|
||||
|
||||
:se cpt=.,w,i
|
||||
kOM
|
||||
|
||||
:se cpt=kXtestfile
|
||||
:w Xtest11.one
|
||||
:w Xtest11.two
|
||||
OIXA
|
||||
:" use CTRL-X CTRL-F to complete Xtest11.one, remove it and then use
|
||||
:" CTRL-X CTRL-F again to verify this doesn't cause trouble.
|
||||
OXddk
|
||||
:se cpt=w
|
||||
OST
|
||||
:se cpt=u nohid
|
||||
oOEN
|
||||
unl
|
||||
:se cpt=t,d def=^\\k* tags=Xtestfile notagbsearch
|
||||
O
|
||||
a
|
||||
:wq! test.out
|
||||
ENDTEST
|
||||
|
||||
start of testfile
|
||||
run1
|
||||
run2
|
||||
end of testfile
|
||||
|
||||
test11 36Gepeto /Tag/
|
||||
asd test11file 36G
|
||||
Makefile to run
|
||||
15
src/nvim/testdir/test32.ok
Normal file
15
src/nvim/testdir/test32.ok
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "Xtestfile"
|
||||
run1 run3
|
||||
run3 run3
|
||||
|
||||
Makefile to run3
|
||||
Makefile to run3
|
||||
Makefile to run3
|
||||
Xtest11.two
|
||||
STARTTEST
|
||||
ENDTEST
|
||||
unless
|
||||
test11file 36Gepeto /Tag/ asd
|
||||
asd
|
||||
run1 run2
|
||||
|
||||
34
src/nvim/testdir/test33.in
Normal file
34
src/nvim/testdir/test33.in
Normal file
@@ -0,0 +1,34 @@
|
||||
Test for 'lisp'
|
||||
If the lisp feature is not enabled, this will fail!
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set lisp
|
||||
/^(defun
|
||||
=G:/^(defun/,$w! test.out
|
||||
:q!
|
||||
ENDTEST
|
||||
|
||||
(defun html-file (base)
|
||||
(format nil "~(~A~).html" base))
|
||||
|
||||
(defmacro page (name title &rest body)
|
||||
(let ((ti (gensym)))
|
||||
`(with-open-file (*standard-output*
|
||||
(html-file ,name)
|
||||
:direction :output
|
||||
:if-exists :supersede)
|
||||
(let ((,ti ,title))
|
||||
(as title ,ti)
|
||||
(with center
|
||||
(as h2 (string-upcase ,ti)))
|
||||
(brs 3)
|
||||
,@body))))
|
||||
|
||||
;;; Utilities for generating links
|
||||
|
||||
(defmacro with-link (dest &rest body)
|
||||
`(progn
|
||||
(format t "<a href=\"~A\">" (html-file ,dest))
|
||||
,@body
|
||||
(princ "</a>")))
|
||||
23
src/nvim/testdir/test33.ok
Normal file
23
src/nvim/testdir/test33.ok
Normal file
@@ -0,0 +1,23 @@
|
||||
(defun html-file (base)
|
||||
(format nil "~(~A~).html" base))
|
||||
|
||||
(defmacro page (name title &rest body)
|
||||
(let ((ti (gensym)))
|
||||
`(with-open-file (*standard-output*
|
||||
(html-file ,name)
|
||||
:direction :output
|
||||
:if-exists :supersede)
|
||||
(let ((,ti ,title))
|
||||
(as title ,ti)
|
||||
(with center
|
||||
(as h2 (string-upcase ,ti)))
|
||||
(brs 3)
|
||||
,@body))))
|
||||
|
||||
;;; Utilities for generating links
|
||||
|
||||
(defmacro with-link (dest &rest body)
|
||||
`(progn
|
||||
(format t "<a href=\"~A\">" (html-file ,dest))
|
||||
,@body
|
||||
(princ "</a>")))
|
||||
87
src/nvim/testdir/test34.in
Normal file
87
src/nvim/testdir/test34.in
Normal file
@@ -0,0 +1,87 @@
|
||||
Test for user functions.
|
||||
Also test an <expr> mapping calling a function.
|
||||
Also test that a builtin function cannot be replaced.
|
||||
Also test for regression when calling arbitrary expression.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:function Table(title, ...)
|
||||
: let ret = a:title
|
||||
: let idx = 1
|
||||
: while idx <= a:0
|
||||
: exe "let ret = ret . a:" . idx
|
||||
: let idx = idx + 1
|
||||
: endwhile
|
||||
: return ret
|
||||
:endfunction
|
||||
:function Compute(n1, n2, divname)
|
||||
: if a:n2 == 0
|
||||
: return "fail"
|
||||
: endif
|
||||
: exe "let g:" . a:divname . " = ". a:n1 / a:n2
|
||||
: return "ok"
|
||||
:endfunction
|
||||
:func Expr1()
|
||||
: normal! v
|
||||
: return "111"
|
||||
:endfunc
|
||||
:func Expr2()
|
||||
: call search('XX', 'b')
|
||||
: return "222"
|
||||
:endfunc
|
||||
:func ListItem()
|
||||
: let g:counter += 1
|
||||
: return g:counter . '. '
|
||||
:endfunc
|
||||
:func ListReset()
|
||||
: let g:counter = 0
|
||||
: return ''
|
||||
:endfunc
|
||||
:func FuncWithRef(a)
|
||||
: unlet g:FuncRef
|
||||
: return a:a
|
||||
:endfunc
|
||||
:let g:FuncRef=function("FuncWithRef")
|
||||
:let counter = 0
|
||||
:inoremap <expr> ( ListItem()
|
||||
:inoremap <expr> [ ListReset()
|
||||
:imap <expr> + Expr1()
|
||||
:imap <expr> * Expr2()
|
||||
:let retval = "nop"
|
||||
/^here
|
||||
C=Table("xxx", 4, "asdf")
|
||||
=Compute(45, 0, "retval")
|
||||
=retval
|
||||
=Compute(45, 5, "retval")
|
||||
=retval
|
||||
=g:FuncRef(333)
|
||||
|
||||
XX+-XX
|
||||
---*---
|
||||
(one
|
||||
(two
|
||||
[(one again:call append(line('$'), max([1, 2, 3]))
|
||||
:call extend(g:, {'max': function('min')})
|
||||
:call append(line('$'), max([1, 2, 3]))
|
||||
:try
|
||||
: " Regression: the first line below used to throw ?E110: Missing ')'?
|
||||
: " Second is here just to prove that this line is correct when not skipping
|
||||
: " rhs of &&.
|
||||
: $put =(0&&(function('tr'))(1, 2, 3))
|
||||
: $put =(1&&(function('tr'))(1, 2, 3))
|
||||
:catch
|
||||
: $put ='!!! Unexpected exception:'
|
||||
: $put =v:exception
|
||||
:endtry
|
||||
:$-9,$w! test.out
|
||||
:delfunc Table
|
||||
:delfunc Compute
|
||||
:delfunc Expr1
|
||||
:delfunc Expr2
|
||||
:delfunc ListItem
|
||||
:delfunc ListReset
|
||||
:unlet retval counter
|
||||
:q!
|
||||
ENDTEST
|
||||
|
||||
here
|
||||
10
src/nvim/testdir/test34.ok
Normal file
10
src/nvim/testdir/test34.ok
Normal file
@@ -0,0 +1,10 @@
|
||||
xxx4asdf fail nop ok 9 333
|
||||
XX111-XX
|
||||
---222---
|
||||
1. one
|
||||
2. two
|
||||
1. one again
|
||||
3
|
||||
3
|
||||
0
|
||||
1
|
||||
21
src/nvim/testdir/test35.in
Normal file
21
src/nvim/testdir/test35.in
Normal file
@@ -0,0 +1,21 @@
|
||||
Test Ctrl-A and Ctrl-X, which increment and decrement decimal, hexadecimal,
|
||||
and octal numbers.
|
||||
|
||||
STARTTEST
|
||||
/^start-here
|
||||
:set nrformats=octal,hex
|
||||
j102ll64128$
|
||||
:set nrformats=octal
|
||||
0102l2w65129blx6lD
|
||||
:set nrformats=hex
|
||||
0101l257Txldt
|
||||
:set nrformats=
|
||||
0200l100w78k
|
||||
:$-3,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
start-here
|
||||
100 0x100 077 0
|
||||
100 0x100 077
|
||||
100 0x100 077 0xfF 0xFf
|
||||
100 0x100 077
|
||||
4
src/nvim/testdir/test35.ok
Normal file
4
src/nvim/testdir/test35.ok
Normal file
@@ -0,0 +1,4 @@
|
||||
0 0x0ff 0000 -1
|
||||
0 1x100 0777777
|
||||
-1 0x0 078 0xFE 0xfe
|
||||
-100 -100x100 000
|
||||
105
src/nvim/testdir/test36.in
Normal file
105
src/nvim/testdir/test36.in
Normal file
@@ -0,0 +1,105 @@
|
||||
Test character classes in regexp using regexpengine 0, 1, 2.
|
||||
|
||||
STARTTEST
|
||||
/^start-here/+1
|
||||
Y:s/\%#=0\d//g
|
||||
p:s/\%#=1\d//g
|
||||
p:s/\%#=2\d//g
|
||||
p:s/\%#=0[0-9]//g
|
||||
p:s/\%#=1[0-9]//g
|
||||
p:s/\%#=2[0-9]//g
|
||||
p:s/\%#=0\D//g
|
||||
p:s/\%#=1\D//g
|
||||
p:s/\%#=2\D//g
|
||||
p:s/\%#=0[^0-9]//g
|
||||
p:s/\%#=1[^0-9]//g
|
||||
p:s/\%#=2[^0-9]//g
|
||||
p:s/\%#=0\o//g
|
||||
p:s/\%#=1\o//g
|
||||
p:s/\%#=2\o//g
|
||||
p:s/\%#=0[0-7]//g
|
||||
p:s/\%#=1[0-7]//g
|
||||
p:s/\%#=2[0-7]//g
|
||||
p:s/\%#=0\O//g
|
||||
p:s/\%#=1\O//g
|
||||
p:s/\%#=2\O//g
|
||||
p:s/\%#=0[^0-7]//g
|
||||
p:s/\%#=1[^0-7]//g
|
||||
p:s/\%#=2[^0-7]//g
|
||||
p:s/\%#=0\x//g
|
||||
p:s/\%#=1\x//g
|
||||
p:s/\%#=2\x//g
|
||||
p:s/\%#=0[0-9A-Fa-f]//g
|
||||
p:s/\%#=1[0-9A-Fa-f]//g
|
||||
p:s/\%#=2[0-9A-Fa-f]//g
|
||||
p:s/\%#=0\X//g
|
||||
p:s/\%#=1\X//g
|
||||
p:s/\%#=2\X//g
|
||||
p:s/\%#=0[^0-9A-Fa-f]//g
|
||||
p:s/\%#=1[^0-9A-Fa-f]//g
|
||||
p:s/\%#=2[^0-9A-Fa-f]//g
|
||||
p:s/\%#=0\w//g
|
||||
p:s/\%#=1\w//g
|
||||
p:s/\%#=2\w//g
|
||||
p:s/\%#=0[0-9A-Za-z_]//g
|
||||
p:s/\%#=1[0-9A-Za-z_]//g
|
||||
p:s/\%#=2[0-9A-Za-z_]//g
|
||||
p:s/\%#=0\W//g
|
||||
p:s/\%#=1\W//g
|
||||
p:s/\%#=2\W//g
|
||||
p:s/\%#=0[^0-9A-Za-z_]//g
|
||||
p:s/\%#=1[^0-9A-Za-z_]//g
|
||||
p:s/\%#=2[^0-9A-Za-z_]//g
|
||||
p:s/\%#=0\h//g
|
||||
p:s/\%#=1\h//g
|
||||
p:s/\%#=2\h//g
|
||||
p:s/\%#=0[A-Za-z_]//g
|
||||
p:s/\%#=1[A-Za-z_]//g
|
||||
p:s/\%#=2[A-Za-z_]//g
|
||||
p:s/\%#=0\H//g
|
||||
p:s/\%#=1\H//g
|
||||
p:s/\%#=2\H//g
|
||||
p:s/\%#=0[^A-Za-z_]//g
|
||||
p:s/\%#=1[^A-Za-z_]//g
|
||||
p:s/\%#=2[^A-Za-z_]//g
|
||||
p:s/\%#=0\a//g
|
||||
p:s/\%#=1\a//g
|
||||
p:s/\%#=2\a//g
|
||||
p:s/\%#=0[A-Za-z]//g
|
||||
p:s/\%#=1[A-Za-z]//g
|
||||
p:s/\%#=2[A-Za-z]//g
|
||||
p:s/\%#=0\A//g
|
||||
p:s/\%#=1\A//g
|
||||
p:s/\%#=2\A//g
|
||||
p:s/\%#=0[^A-Za-z]//g
|
||||
p:s/\%#=1[^A-Za-z]//g
|
||||
p:s/\%#=2[^A-Za-z]//g
|
||||
p:s/\%#=0\l//g
|
||||
p:s/\%#=1\l//g
|
||||
p:s/\%#=2\l//g
|
||||
p:s/\%#=0[a-z]//g
|
||||
p:s/\%#=1[a-z]//g
|
||||
p:s/\%#=2[a-z]//g
|
||||
p:s/\%#=0\L//g
|
||||
p:s/\%#=1\L//g
|
||||
p:s/\%#=2\L//g
|
||||
p:s/\%#=0[^a-z]//g
|
||||
p:s/\%#=1[^a-z]//g
|
||||
p:s/\%#=2[^a-z]//g
|
||||
p:s/\%#=0\u//g
|
||||
p:s/\%#=1\u//g
|
||||
p:s/\%#=2\u//g
|
||||
p:s/\%#=0[A-Z]//g
|
||||
p:s/\%#=1[A-Z]//g
|
||||
p:s/\%#=2[A-Z]//g
|
||||
p:s/\%#=0\U//g
|
||||
p:s/\%#=1\U//g
|
||||
p:s/\%#=2\U//g
|
||||
p:s/\%#=0[^A-Z]//g
|
||||
p:s/\%#=1[^A-Z]//g
|
||||
p:s/\%#=2[^A-Z]//g
|
||||
:/^start-here/+1,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
start-here
|
||||
|
||||
96
src/nvim/testdir/test36.ok
Normal file
96
src/nvim/testdir/test36.ok
Normal file
@@ -0,0 +1,96 @@
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
0123456789
|
||||
0123456789
|
||||
0123456789
|
||||
0123456789
|
||||
0123456789
|
||||
0123456789
|
||||
|
||||
!"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
01234567
|
||||
01234567
|
||||
01234567
|
||||
01234567
|
||||
01234567
|
||||
01234567
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
0123456789ABCDEFabcdef
|
||||
0123456789ABCDEFabcdef
|
||||
0123456789ABCDEFabcdef
|
||||
0123456789ABCDEFabcdef
|
||||
0123456789ABCDEFabcdef
|
||||
0123456789ABCDEFabcdef
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
0123456789ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
0123456789ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
0123456789ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
0123456789ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
0123456789ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
0123456789ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
ABCDEFGHIXYZ_abcdefghiwxyz
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
!"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~<><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
116
src/nvim/testdir/test37.in
Normal file
116
src/nvim/testdir/test37.in
Normal file
@@ -0,0 +1,116 @@
|
||||
Test for 'scrollbind'. <eralston@computer.org> Do not add a line below!
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set noscrollbind
|
||||
:set scrollopt=ver,jump
|
||||
:set scrolloff=2
|
||||
:set nowrap
|
||||
:set noequalalways
|
||||
:set splitbelow
|
||||
:" TEST using two windows open to one buffer, one extra empty window
|
||||
:split
|
||||
:new
|
||||
t:
|
||||
:resize 8
|
||||
/^start of window 1$/
|
||||
zt:
|
||||
:set scrollbind
|
||||
j:
|
||||
:resize 7
|
||||
/^start of window 2$/
|
||||
zt:
|
||||
:set scrollbind
|
||||
:" -- start of tests --
|
||||
:" TEST scrolling down
|
||||
L5jHyybpr0tHyybpr1tL6jHyybpr2kHyybpr3:
|
||||
:" TEST scrolling up
|
||||
tH4kjHtHyybpr4kHyybpr5k3ktHjHyybpr6tHyybpr7:
|
||||
:" TEST horizontal scrolling
|
||||
:set scrollopt+=hor
|
||||
gg"zyyG"zpGt015zly$bp"zpGky$bp"zpG:
|
||||
k10jH7zhg0y$bp"zpGtHg0y$bp"zpG:
|
||||
:set scrollopt-=hor
|
||||
:" ****** tests using two different buffers *****
|
||||
tj:
|
||||
:close
|
||||
t:
|
||||
:set noscrollbind
|
||||
:/^start of window 2$/,/^end of window 2$/y
|
||||
:new
|
||||
tj4"zpGp:
|
||||
t/^start of window 1$/
|
||||
zt:
|
||||
:set scrollbind
|
||||
j:
|
||||
/^start of window 2$/
|
||||
zt:
|
||||
:set scrollbind
|
||||
:" -- start of tests --
|
||||
:" TEST scrolling down
|
||||
L5jHyybpr0tHyybpr1tL6jHyybpr2kHyybpr3:
|
||||
:" TEST scrolling up
|
||||
tH4kjHtHyybpr4kHyybpr5k3ktHjHyybpr6tHyybpr7:
|
||||
:" TEST horizontal scrolling
|
||||
:set scrollopt+=hor
|
||||
gg"zyyG"zpGt015zly$bp"zpGky$bp"zpG:
|
||||
k10jH7zhg0y$bp"zpGtHg0y$bp"zpG:
|
||||
:set scrollopt-=hor
|
||||
:" TEST syncbind
|
||||
t:set noscb
|
||||
ggLj:set noscb
|
||||
ggL:set scb
|
||||
t:set scb
|
||||
GjG:syncbind
|
||||
HktHjHyybptyybp:
|
||||
t:set noscb
|
||||
ggLj:set noscb
|
||||
ggL:set scb
|
||||
t:set scb
|
||||
tGjGt:syncbind
|
||||
HkjHtHyybptjyybp:
|
||||
tH3kjHtHyybptjyybp:
|
||||
:" ***** done with tests *****
|
||||
:w! test.out " Write contents of this file
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
|
||||
start of window 1
|
||||
. line 01 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 01
|
||||
. line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
|
||||
. line 03 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 03
|
||||
. line 04 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 04
|
||||
. line 05 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 05
|
||||
. line 06 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 06
|
||||
. line 07 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 07
|
||||
. line 08 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 08
|
||||
. line 09 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 09
|
||||
. line 10 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 10
|
||||
. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
|
||||
. line 12 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 12
|
||||
. line 13 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 13
|
||||
. line 14 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 14
|
||||
. line 15 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 15
|
||||
end of window 1
|
||||
|
||||
|
||||
start of window 2
|
||||
. line 01 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 01
|
||||
. line 02 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 02
|
||||
. line 03 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 03
|
||||
. line 04 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 04
|
||||
. line 05 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 05
|
||||
. line 06 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 06
|
||||
. line 07 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 07
|
||||
. line 08 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 08
|
||||
. line 09 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 09
|
||||
. line 10 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 10
|
||||
. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
|
||||
. line 12 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 12
|
||||
. line 13 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 13
|
||||
. line 14 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 14
|
||||
. line 15 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 15
|
||||
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
|
||||
end of window 2
|
||||
|
||||
end of test37.in (please don't delete this line)
|
||||
33
src/nvim/testdir/test37.ok
Normal file
33
src/nvim/testdir/test37.ok
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
0 line 05 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 05
|
||||
1 line 05 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 05
|
||||
2 line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
|
||||
3 line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
|
||||
4 line 06 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 06
|
||||
5 line 06 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 06
|
||||
6 line 02 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 02
|
||||
7 line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
|
||||
56789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
|
||||
UTSRQPONMLKJIHGREDCBA9876543210 02
|
||||
. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
|
||||
. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
|
||||
|
||||
0 line 05 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 05
|
||||
1 line 05 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 05
|
||||
2 line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
|
||||
3 line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
|
||||
4 line 06 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 06
|
||||
5 line 06 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 06
|
||||
6 line 02 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 02
|
||||
7 line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
|
||||
56789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
|
||||
UTSRQPONMLKJIHGREDCBA9876543210 02
|
||||
. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
|
||||
. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
|
||||
|
||||
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
|
||||
:set scrollbind
|
||||
:set scrollbind
|
||||
. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
|
||||
j:
|
||||
. line 12 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 12
|
||||
35
src/nvim/testdir/test38.in
Normal file
35
src/nvim/testdir/test38.in
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
Test Virtual replace mode.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" make sure that backspace works, no matter what termcap is used
|
||||
:set t_kD=x7f t_kb=x08
|
||||
ggdGa
|
||||
abcdefghi
|
||||
jk lmn
|
||||
opq rst
|
||||
uvwxyz
|
||||
gg:set ai
|
||||
:set bs=2
|
||||
gR0 1
|
||||
A
|
||||
BCDEFGHIJ
|
||||
KL
|
||||
MNO
|
||||
PQRG:ka
|
||||
o0
|
||||
abcdefghi
|
||||
jk lmn
|
||||
opq rst
|
||||
uvwxyz
|
||||
'ajgR0 1
|
||||
A
|
||||
BCDEFGHIJ
|
||||
KL
|
||||
MNO
|
||||
PQR:$
|
||||
iab cdefghi jkl0gRAB......CDEFGHI.Jo:
|
||||
iabcdefghijklmnopqrst0gRAB IJKLMNO QR:wq! test.out
|
||||
ENDTEST
|
||||
|
||||
13
src/nvim/testdir/test38.ok
Normal file
13
src/nvim/testdir/test38.ok
Normal file
@@ -0,0 +1,13 @@
|
||||
1
|
||||
A
|
||||
BCDEFGHIJ
|
||||
KL
|
||||
MNO
|
||||
PQR
|
||||
1
|
||||
abcdefghi
|
||||
jk lmn
|
||||
opq rst
|
||||
uvwxyz
|
||||
AB......CDEFGHI.Jkl
|
||||
AB IJKLMNO QRst
|
||||
93
src/nvim/testdir/test39.in
Normal file
93
src/nvim/testdir/test39.in
Normal file
@@ -0,0 +1,93 @@
|
||||
|
||||
Test Visual block mode commands
|
||||
And test "U" in Visual mode, also on German sharp S.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:so mbyte.vim
|
||||
:" This only works when 'encoding' is "latin1", don't depend on the environment
|
||||
:set enc=latin1
|
||||
/^abcde
|
||||
:" Test shift-right of a block
|
||||
jlllljj>wlljlll>
|
||||
:" Test shift-left of a block
|
||||
G$hhhhkk<
|
||||
:" Test block-insert
|
||||
GklkkkIxyz
|
||||
:" Test block-replace
|
||||
Gllllkkklllrq
|
||||
:" Test block-change
|
||||
G$khhhhhkkcmno
|
||||
:$-4,$w! test.out
|
||||
:" Test block-insert using cursor keys for movement
|
||||
/^aaaa/
|
||||
:exe ":norm! l\<C-V>jjjlllI\<Right>\<Right> \<Esc>"
|
||||
:/^aa/,/^$/w >> test.out
|
||||
:" Test for Visual block was created with the last <C-v>$
|
||||
/^A23$/
|
||||
:exe ":norm! l\<C-V>j$Aab\<Esc>"
|
||||
:.,/^$/w >> test.out
|
||||
:" Test for Visual block was created with the middle <C-v>$ (1)
|
||||
/^B23$/
|
||||
:exe ":norm! l\<C-V>j$hAab\<Esc>"
|
||||
:.,/^$/w >> test.out
|
||||
:" Test for Visual block was created with the middle <C-v>$ (2)
|
||||
/^C23$/
|
||||
:exe ":norm! l\<C-V>j$hhAab\<Esc>"
|
||||
:.,/^$/w >> test.out
|
||||
:" Test for Visual block insert when virtualedit=all
|
||||
:set ve=all
|
||||
:/\t\tline
|
||||
:exe ":norm! 07l\<C-V>jjIx\<Esc>"
|
||||
:set ve=
|
||||
:.,/^$/w >> test.out
|
||||
:" gUe must uppercase a whole word, also when <20> changes to SS
|
||||
Gothe youtu<74>euu endYpk0wgUe
|
||||
:" gUfx must uppercase until x, inclusive.
|
||||
O- you<6F>tu<74>exu -0fogUfx
|
||||
:" VU must uppercase a whole line
|
||||
YpkVU
|
||||
:" same, when it's the last line in the buffer
|
||||
YPGi111VUddP
|
||||
:" Uppercase two lines
|
||||
Oblah di
|
||||
doh dutVkUj
|
||||
:" Uppercase part of two lines
|
||||
ddppi333k0i222fyllvjfuUk
|
||||
:" visual replace using Enter or NL
|
||||
G3o1234567892k05l2jr
|
||||
G3o987652k02l2jr
|
||||
G3o1234567892k05l2jr
|
||||
G3o987652k02l2jr
|
||||
:"
|
||||
:" Test cursor position. When ve=block and Visual block mode and $gj
|
||||
:set ve=block
|
||||
:exe ":norm! 2k\<C-V>$gj\<Esc>"
|
||||
:let cpos=getpos("'>")
|
||||
:$put ='col:'.cpos[2].' off:'.cpos[3]
|
||||
:/^the/,$w >> test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
line1
|
||||
line2
|
||||
line3
|
||||
|
||||
aaaaaa
|
||||
bbbbbb
|
||||
cccccc
|
||||
dddddd
|
||||
|
||||
A23
|
||||
4567
|
||||
|
||||
B23
|
||||
4567
|
||||
|
||||
C23
|
||||
4567
|
||||
|
||||
abcdefghijklm
|
||||
abcdefghijklm
|
||||
abcdefghijklm
|
||||
abcdefghijklm
|
||||
BIN
src/nvim/testdir/test39.ok
Normal file
BIN
src/nvim/testdir/test39.ok
Normal file
Binary file not shown.
31
src/nvim/testdir/test4.in
Normal file
31
src/nvim/testdir/test4.in
Normal file
@@ -0,0 +1,31 @@
|
||||
Test for autocommand that changes current buffer on BufEnter event.
|
||||
Check if modelines are interpreted for the correct buffer.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocompatible viminfo+=nviminfo
|
||||
:au BufEnter Xxx brew
|
||||
/start of
|
||||
:.,/end of/w! Xxx " write test file Xxx
|
||||
:set ai modeline modelines=3
|
||||
:sp Xxx " split to Xxx, autocmd will do :brew
|
||||
G?this is a
|
||||
othis should be auto-indented
|
||||
: " Append text with autoindent to this file
|
||||
:au! BufEnter Xxx
|
||||
:buf Xxx " go to Xxx, no autocmd anymore
|
||||
G?this is a
|
||||
othis should be in column 1:wq " append text without autoindent to Xxx
|
||||
G:r Xxx " include Xxx in the current file
|
||||
:?startstart?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
startstart
|
||||
start of test file Xxx
|
||||
vim: set noai :
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
end of test file Xxx
|
||||
17
src/nvim/testdir/test4.ok
Normal file
17
src/nvim/testdir/test4.ok
Normal file
@@ -0,0 +1,17 @@
|
||||
startstart
|
||||
start of test file Xxx
|
||||
vim: set noai :
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this should be auto-indented
|
||||
end of test file Xxx
|
||||
start of test file Xxx
|
||||
vim: set noai :
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this should be in column 1
|
||||
end of test file Xxx
|
||||
63
src/nvim/testdir/test40.in
Normal file
63
src/nvim/testdir/test40.in
Normal file
@@ -0,0 +1,63 @@
|
||||
Test for "*Cmd" autocommands
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:/^start/,$w! Xxx " write lines below to Xxx
|
||||
:au BufReadCmd XtestA 0r Xxx|$del
|
||||
:e XtestA " will read text of Xxd instead
|
||||
:au BufWriteCmd XtestA call append(line("$"), "write")
|
||||
:w " will append a line to the file
|
||||
:r XtestA " should not read anything
|
||||
: " now we have:
|
||||
: " 1 start of Xxx
|
||||
: " 2 test40
|
||||
: " 3 end of Xxx
|
||||
: " 4 write
|
||||
:au FileReadCmd XtestB '[r Xxx
|
||||
:2r XtestB " will read Xxx below line 2 instead
|
||||
: " 1 start of Xxx
|
||||
: " 2 test40
|
||||
: " 3 start of Xxx
|
||||
: " 4 test40
|
||||
: " 5 end of Xxx
|
||||
: " 6 end of Xxx
|
||||
: " 7 write
|
||||
:au FileWriteCmd XtestC '[,']copy $
|
||||
4GA1
|
||||
:4,5w XtestC " will copy lines 4 and 5 to the end
|
||||
:r XtestC " should not read anything
|
||||
: " 1 start of Xxx
|
||||
: " 2 test40
|
||||
: " 3 start of Xxx
|
||||
: " 4 test401
|
||||
: " 5 end of Xxx
|
||||
: " 6 end of Xxx
|
||||
: " 7 write
|
||||
: " 8 test401
|
||||
: " 9 end of Xxx
|
||||
:au FILEAppendCmd XtestD '[,']w! test.out
|
||||
:w >>XtestD " will write all lines to test.out
|
||||
:$r XtestD " should not read anything
|
||||
:$w >>test.out " append "end of Xxx" to test.out
|
||||
:au BufReadCmd XtestE 0r test.out|$del
|
||||
:sp XtestE " split window with test.out
|
||||
5Goasdf:"
|
||||
:au BufWriteCmd XtestE w! test.out
|
||||
:wall " will write other window to test.out
|
||||
: " 1 start of Xxx
|
||||
: " 2 test40
|
||||
: " 3 start of Xxx
|
||||
: " 4 test401
|
||||
: " 5 end of Xxx
|
||||
: " 6 asdf
|
||||
: " 7 end of Xxx
|
||||
: " 8 write
|
||||
: " 9 test401
|
||||
: " 10 end of Xxx
|
||||
: " 11 end of Xxx
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of Xxx
|
||||
test40
|
||||
end of Xxx
|
||||
11
src/nvim/testdir/test40.ok
Normal file
11
src/nvim/testdir/test40.ok
Normal file
@@ -0,0 +1,11 @@
|
||||
start of Xxx
|
||||
test40
|
||||
start of Xxx
|
||||
test401
|
||||
end of Xxx
|
||||
asdf
|
||||
end of Xxx
|
||||
write
|
||||
test401
|
||||
end of Xxx
|
||||
end of Xxx
|
||||
24
src/nvim/testdir/test41.in
Normal file
24
src/nvim/testdir/test41.in
Normal file
@@ -0,0 +1,24 @@
|
||||
Test for writing and reading a file of over 100 Kbyte
|
||||
|
||||
1 line: "This is the start"
|
||||
3001 lines: "This is the leader"
|
||||
1 line: "This is the middle"
|
||||
3001 lines: "This is the trailer"
|
||||
1 line: "This is the end"
|
||||
|
||||
STARTTEST
|
||||
:%d
|
||||
aThis is the start
|
||||
This is the leader
|
||||
This is the middle
|
||||
This is the trailer
|
||||
This is the endkY3000p2GY3000p
|
||||
:w! Xtest
|
||||
:%d
|
||||
:e! Xtest
|
||||
:.w! test.out
|
||||
3003G:.w >>test.out
|
||||
6005G:.w >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
3
src/nvim/testdir/test41.ok
Normal file
3
src/nvim/testdir/test41.ok
Normal file
@@ -0,0 +1,3 @@
|
||||
This is the start
|
||||
This is the middle
|
||||
This is the end
|
||||
BIN
src/nvim/testdir/test42.in
Normal file
BIN
src/nvim/testdir/test42.in
Normal file
Binary file not shown.
BIN
src/nvim/testdir/test42.ok
Normal file
BIN
src/nvim/testdir/test42.ok
Normal file
Binary file not shown.
34
src/nvim/testdir/test43.in
Normal file
34
src/nvim/testdir/test43.in
Normal file
@@ -0,0 +1,34 @@
|
||||
Tests for regexp with various magic settings.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocompatible viminfo+=nviminfo
|
||||
/^1
|
||||
/a*b\{2}c\+/e
|
||||
x/\Md\*e\{2}f\+/e
|
||||
x:set nomagic
|
||||
/g\*h\{2}i\+/e
|
||||
x/\mj*k\{2}l\+/e
|
||||
x/\vm*n{2}o+/e
|
||||
x/\V^aa$
|
||||
x:set magic
|
||||
/\v(a)(b)\2\1\1/e
|
||||
x/\V[ab]\(\[xy]\)\1
|
||||
x:$
|
||||
:set undolevels=100
|
||||
dv?bar?
|
||||
Yup:"
|
||||
:?^1?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
1 a aa abb abbccc
|
||||
2 d dd dee deefff
|
||||
3 g gg ghh ghhiii
|
||||
4 j jj jkk jkklll
|
||||
5 m mm mnn mnnooo
|
||||
6 x ^aa$ x
|
||||
7 (a)(b) abbaa
|
||||
8 axx [ab]xx
|
||||
9 foobar
|
||||
|
||||
11
src/nvim/testdir/test43.ok
Normal file
11
src/nvim/testdir/test43.ok
Normal file
@@ -0,0 +1,11 @@
|
||||
1 a aa abb abbcc
|
||||
2 d dd dee deeff
|
||||
3 g gg ghh ghhii
|
||||
4 j jj jkk jkkll
|
||||
5 m mm mnn mnnoo
|
||||
6 x aa$ x
|
||||
7 (a)(b) abba
|
||||
8 axx ab]xx
|
||||
9 foobar
|
||||
9 foo
|
||||
|
||||
68
src/nvim/testdir/test44.in
Normal file
68
src/nvim/testdir/test44.in
Normal file
@@ -0,0 +1,68 @@
|
||||
Tests for regexp with multi-byte encoding and various magic settings.
|
||||
Test matchstr() with a count and multi-byte chars.
|
||||
See test99 for exactly the same test with re=2.
|
||||
|
||||
STARTTEST
|
||||
:so mbyte.vim
|
||||
:set nocompatible encoding=utf-8 termencoding=latin1 viminfo+=nviminfo
|
||||
:set re=1
|
||||
/^1
|
||||
/a*b\{2}c\+/e
|
||||
x/\Md\*e\{2}f\+/e
|
||||
x:set nomagic
|
||||
/g\*h\{2}i\+/e
|
||||
x/\mj*k\{2}l\+/e
|
||||
x/\vm*n{2}o+/e
|
||||
x/\V^aa$
|
||||
x:set magic
|
||||
/\v(a)(b)\2\1\1/e
|
||||
x/\V[ab]\(\[xy]\)\1
|
||||
x:" Now search for multi-byte without composing char
|
||||
/ม
|
||||
x:" Now search for multi-byte with composing char
|
||||
/ม่
|
||||
x:" find word by change of word class
|
||||
/ち\<カヨ\>は
|
||||
x:" Test \%u, [\u] and friends
|
||||
/\%u20ac
|
||||
x/[\u4f7f\u5929]\+
|
||||
x/\%U12345678
|
||||
x/[\U1234abcd\u1234\uabcd]
|
||||
x/\%d21879b
|
||||
x/ [[=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=]]*/e
|
||||
x/ [[=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=]]*/e
|
||||
x:" Test backwards search from a multi-byte char
|
||||
/x
|
||||
x?.
|
||||
x:let @w=':%s#comb[i]nations#œ̄ṣ́m̥̄ᾱ̆́#g'
|
||||
:@w
|
||||
:?^1?,$w! test.out
|
||||
:e! test.out
|
||||
G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב
|
||||
:put =matchstr(\"אבגד\", \"..\", 0, 2) " בג
|
||||
:put =matchstr(\"אבגד\", \".\", 0, 0) " א
|
||||
:put =matchstr(\"אבגד\", \".\", 4, -1) " ג
|
||||
:w!
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
1 a aa abb abbccc
|
||||
2 d dd dee deefff
|
||||
3 g gg ghh ghhiii
|
||||
4 j jj jkk jkklll
|
||||
5 m mm mnn mnnooo
|
||||
6 x ^aa$ x
|
||||
7 (a)(b) abbaa
|
||||
8 axx [ab]xx
|
||||
9 หม่x อมx
|
||||
a อมx หม่x
|
||||
b ちカヨは
|
||||
c x ¬€x
|
||||
d 天使x
|
||||
e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y
|
||||
f <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>z
|
||||
g a啷bb
|
||||
h 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ŹŻŽƵẐẔ
|
||||
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ
|
||||
j 0123❤x
|
||||
k combinations
|
||||
24
src/nvim/testdir/test44.ok
Normal file
24
src/nvim/testdir/test44.ok
Normal file
@@ -0,0 +1,24 @@
|
||||
1 a aa abb abbcc
|
||||
2 d dd dee deeff
|
||||
3 g gg ghh ghhii
|
||||
4 j jj jkk jkkll
|
||||
5 m mm mnn mnnoo
|
||||
6 x aa$ x
|
||||
7 (a)(b) abba
|
||||
8 axx ab]xx
|
||||
9 หม่x อx
|
||||
a อมx หx
|
||||
b カヨは
|
||||
c x ¬x
|
||||
d 使x
|
||||
e y
|
||||
f z
|
||||
g abb
|
||||
h 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ŹŻŽƵẐ
|
||||
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑ
|
||||
j 012❤
|
||||
k œ̄ṣ́m̥̄ᾱ̆́
|
||||
ב
|
||||
בג
|
||||
א
|
||||
ג
|
||||
80
src/nvim/testdir/test45.in
Normal file
80
src/nvim/testdir/test45.in
Normal file
@@ -0,0 +1,80 @@
|
||||
Tests for folding. vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" We also need the +syntax feature here.
|
||||
:if !has("syntax")
|
||||
e! test.ok
|
||||
w! test.out
|
||||
qa!
|
||||
:endif
|
||||
:" basic test if a fold can be created, opened, moving to the end and closed
|
||||
/^1
|
||||
zf2j:call append("$", "manual " . getline(foldclosed(".")))
|
||||
zo:call append("$", foldclosed("."))
|
||||
]z:call append("$", getline("."))
|
||||
zc:call append("$", getline(foldclosed(".")))
|
||||
:" test folding with markers.
|
||||
:set fdm=marker fdl=1 fdc=3
|
||||
/^5
|
||||
:call append("$", "marker " . foldlevel("."))
|
||||
[z:call append("$", foldlevel("."))
|
||||
jo{{ r{jj:call append("$", foldlevel("."))
|
||||
kYpj:call append("$", foldlevel("."))
|
||||
:" test folding with indent
|
||||
:set fdm=indent sw=2
|
||||
/^2 b
|
||||
i jI :call append("$", "indent " . foldlevel("."))
|
||||
k:call append("$", foldlevel("."))
|
||||
:" test syntax folding
|
||||
:set fdm=syntax fdl=0
|
||||
:syn region Hup start="dd" end="ii" fold contains=Fd1,Fd2,Fd3
|
||||
:syn region Fd1 start="ee" end="ff" fold contained
|
||||
:syn region Fd2 start="gg" end="hh" fold contained
|
||||
:syn region Fd3 start="commentstart" end="commentend" fold contained
|
||||
Gzk:call append("$", "folding " . getline("."))
|
||||
k:call append("$", getline("."))
|
||||
jAcommentstart Acommentend:set fdl=1
|
||||
3j:call append("$", getline("."))
|
||||
:set fdl=0
|
||||
zOj:call append("$", getline("."))
|
||||
:" test expression folding
|
||||
:fun Flvl()
|
||||
let l = getline(v:lnum)
|
||||
if l =~ "bb$"
|
||||
return 2
|
||||
elseif l =~ "gg$"
|
||||
return "s1"
|
||||
elseif l =~ "ii$"
|
||||
return ">2"
|
||||
elseif l =~ "kk$"
|
||||
return "0"
|
||||
endif
|
||||
return "="
|
||||
endfun
|
||||
:set fdm=expr fde=Flvl()
|
||||
/bb$
|
||||
:call append("$", "expr " . foldlevel("."))
|
||||
/hh$
|
||||
:call append("$", foldlevel("."))
|
||||
/ii$
|
||||
:call append("$", foldlevel("."))
|
||||
/kk$
|
||||
:call append("$", foldlevel("."))
|
||||
:/^last/+1,$w! test.out
|
||||
:delfun Flvl
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
1 aa
|
||||
2 bb
|
||||
3 cc
|
||||
4 dd {{{
|
||||
5 ee {{{ }}}
|
||||
6 ff }}}
|
||||
7 gg
|
||||
8 hh
|
||||
9 ii
|
||||
a jj
|
||||
b kk
|
||||
last
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user