diff options
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/Make_all.mak | 10 | ||||
-rw-r--r-- | src/testdir/test_marks.in | 34 | ||||
-rw-r--r-- | src/testdir/test_marks.ok | 16 | ||||
-rw-r--r-- | src/testdir/test_marks.vim | 26 | ||||
-rw-r--r-- | src/testdir/test_nested_function.in | 34 | ||||
-rw-r--r-- | src/testdir/test_nested_function.ok | 6 | ||||
-rw-r--r-- | src/testdir/test_nested_function.vim | 32 | ||||
-rw-r--r-- | src/testdir/test_writefile.in | 19 | ||||
-rw-r--r-- | src/testdir/test_writefile.ok | 5 | ||||
-rw-r--r-- | src/testdir/test_writefile.vim | 16 |
10 files changed, 79 insertions, 119 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index c8d23eafc..76f86ec2b 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -86,7 +86,7 @@ SCRIPTS_ALL = \ test_autoformat_join.out \ test_breakindent.out \ test_changelist.out \ - test_charsearch.out \ + test_charsearch.out \ test_close_count.out \ test_command_count.out \ test_comparators.out \ @@ -97,12 +97,9 @@ SCRIPTS_ALL = \ test_insertcount.out \ test_listchars.out \ test_listlbr.out \ - test_marks.out \ - test_nested_function.out \ test_search_mbyte.out \ test_utf8.out \ - test_wordcount.out \ - test_writefile.out + test_wordcount.out # Tests that run on most systems, but not on Amiga. @@ -175,7 +172,9 @@ NEW_TESTS = test_arglist.res \ test_json.res \ test_langmap.res \ test_man.res \ + test_marks.res \ test_matchadd_conceal.res \ + test_nested_function.res \ test_netbeans.res \ test_packadd.res \ test_perl.res \ @@ -194,6 +193,7 @@ NEW_TESTS = test_arglist.res \ test_viml.res \ test_visual.res \ test_window_id.res \ + test_writefile.res \ test_alot_latin.res \ test_alot_utf8.res \ test_alot.res diff --git a/src/testdir/test_marks.in b/src/testdir/test_marks.in deleted file mode 100644 index 23c2fb65f..000000000 --- a/src/testdir/test_marks.in +++ /dev/null @@ -1,34 +0,0 @@ -Tests for marks. - -STARTTEST -:so small.vim -:" test that a deleted mark is restored after delete-undo-redo-undo -:/^\t/+1 -:set nocp viminfo+=nviminfo -madduu -:let a = string(getpos("'a")) -:$put ='Mark after delete-undo-redo-undo: '.a -:'' -ENDTEST - - textline A - textline B - textline C - -STARTTEST -:" test that CTRL-A and CTRL-X updates last changed mark '[, ']. -:/^123/ -:execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX" -ENDTEST - -CTRL-A CTRL-X: -123 123 123 -123 123 123 -123 123 123 - -STARTTEST -:g/^STARTTEST/.,/^ENDTEST/d -:wq! test.out -ENDTEST - -Results: diff --git a/src/testdir/test_marks.ok b/src/testdir/test_marks.ok deleted file mode 100644 index e6c02ee7b..000000000 --- a/src/testdir/test_marks.ok +++ /dev/null @@ -1,16 +0,0 @@ -Tests for marks. - - - textline A - textline B - textline C - - -CTRL-A CTRL-X: -AAA 123 123 -123 XXXXXXX -XXX 123 123 - - -Results: -Mark after delete-undo-redo-undo: [0, 15, 2, 0] diff --git a/src/testdir/test_marks.vim b/src/testdir/test_marks.vim new file mode 100644 index 000000000..d00b1ddc8 --- /dev/null +++ b/src/testdir/test_marks.vim @@ -0,0 +1,26 @@ + +" Test that a deleted mark is restored after delete-undo-redo-undo. +function! Test_Restore_DelMark() + enew! + call append(0, [" textline A", " textline B", " textline C"]) + normal! 2gg + set nocp viminfo+=nviminfo + exe "normal! i\<C-G>u\<Esc>" + exe "normal! maddu\<C-R>u" + let pos = getpos("'a") + call assert_equal(2, pos[1]) + call assert_equal(1, pos[2]) + enew! +endfunction + +" Test that CTRL-A and CTRL-X updates last changed mark '[, ']. +function! Test_Incr_Marks() + enew! + call append(0, ["123 123 123", "123 123 123", "123 123 123"]) + normal! gg + execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX" + call assert_equal("AAA 123 123", getline(1)) + call assert_equal("123 XXXXXXX", getline(2)) + call assert_equal("XXX 123 123", getline(3)) + enew! +endfunction diff --git a/src/testdir/test_nested_function.in b/src/testdir/test_nested_function.in deleted file mode 100644 index 534164a50..000000000 --- a/src/testdir/test_nested_function.in +++ /dev/null @@ -1,34 +0,0 @@ -Tests for Nested function vim: set ft=vim : - -STARTTEST -:so small.vim -:fu! NestedFunc() -: fu! Func1() -: $put ='Func1' -: endfunction -: call Func1() -: fu! s:func2() -: $put ='s:func2' -: endfunction -: call s:func2() -: fu! s:_func3() -: $put ='s:_func3' -: endfunction -: call s:_func3() -: let fn = 'Func4' -: fu! {fn}() -: $put ='Func4' -: endfunction -: call {fn}() -: let fn = 'func5' -: fu! s:{fn}() -: $put ='s:func5' -: endfunction -: call s:{fn}() -:endfunction -:call NestedFunc() -:/^result:/,$w! test.out -:qa! -ENDTEST - -result: diff --git a/src/testdir/test_nested_function.ok b/src/testdir/test_nested_function.ok deleted file mode 100644 index c1fd19afe..000000000 --- a/src/testdir/test_nested_function.ok +++ /dev/null @@ -1,6 +0,0 @@ -result: -Func1 -s:func2 -s:_func3 -Func4 -s:func5 diff --git a/src/testdir/test_nested_function.vim b/src/testdir/test_nested_function.vim new file mode 100644 index 000000000..f88173052 --- /dev/null +++ b/src/testdir/test_nested_function.vim @@ -0,0 +1,32 @@ +"Tests for nested functions +" +function! NestedFunc() + fu! Func1() + let g:text .= 'Func1 ' + endfunction + call Func1() + fu! s:func2() + let g:text .= 's:func2 ' + endfunction + call s:func2() + fu! s:_func3() + let g:text .= 's:_func3 ' + endfunction + call s:_func3() + let fn = 'Func4' + fu! {fn}() + let g:text .= 'Func4 ' + endfunction + call {fn}() + let fn = 'func5' + fu! s:{fn}() + let g:text .= 's:func5' + endfunction + call s:{fn}() +endfunction + +function! Test_nested_functions() + let g:text = '' + call NestedFunc() + call assert_equal('Func1 s:func2 s:_func3 Func4 s:func5', g:text) +endfunction diff --git a/src/testdir/test_writefile.in b/src/testdir/test_writefile.in deleted file mode 100644 index 6b354c510..000000000 --- a/src/testdir/test_writefile.in +++ /dev/null @@ -1,19 +0,0 @@ -Tests for writefile() - -STARTTEST -:source small.vim -:%delete _ -:let f = tempname() -:call writefile(["over","written"], f, "b") -:call writefile(["hello","world"], f, "b") -:call writefile(["!", "good"], f, "a") -:call writefile(["morning"], f, "ab") -:call writefile(["", "vimmers"], f, "ab") -:bwipeout! -:$put =readfile(f) -:1 delete _ -:w! test.out -:call delete(f) -:qa! -ENDTEST - diff --git a/src/testdir/test_writefile.ok b/src/testdir/test_writefile.ok deleted file mode 100644 index dfb6a2b29..000000000 --- a/src/testdir/test_writefile.ok +++ /dev/null @@ -1,5 +0,0 @@ -hello -world! -good -morning -vimmers diff --git a/src/testdir/test_writefile.vim b/src/testdir/test_writefile.vim new file mode 100644 index 000000000..d820c580a --- /dev/null +++ b/src/testdir/test_writefile.vim @@ -0,0 +1,16 @@ + +function! Test_WriteFile() + let f = tempname() + call writefile(["over","written"], f, "b") + call writefile(["hello","world"], f, "b") + call writefile(["!", "good"], f, "a") + call writefile(["morning"], f, "ab") + call writefile(["", "vimmers"], f, "ab") + let l = readfile(f) + call assert_equal("hello", l[0]) + call assert_equal("world!", l[1]) + call assert_equal("good", l[2]) + call assert_equal("morning", l[3]) + call assert_equal("vimmers", l[4]) + call delete(f) +endfunction |