Skip to content

Commit

Permalink
patch 7.4.2305
Browse files Browse the repository at this point in the history
Problem:    Marks, writefile and nested function tests are old style.
Solution:   Turn them into new style tests. (Yegappan Lakshmanan)
  • Loading branch information
brammool committed Sep 1, 2016
1 parent 417ccd7 commit 19a1669
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 122 deletions.
6 changes: 3 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2039,12 +2039,9 @@ test1 \
test_listchars \
test_listlbr \
test_listlbr_utf8 \
test_marks \
test_nested_function \
test_search_mbyte \
test_utf8 \
test_wordcount \
test_writefile \
test2 test3 test4 test5 test6 test7 test8 test9 \
test11 test12 test13 test14 test15 test17 test18 test19 \
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
Expand Down Expand Up @@ -2105,11 +2102,13 @@ test_arglist \
test_lispwords \
test_man \
test_mapping \
test_marks \
test_match \
test_matchadd_conceal \
test_matchadd_conceal_utf8 \
test_menu \
test_messages \
test_nested_function \
test_netbeans \
test_options \
test_packadd \
Expand Down Expand Up @@ -2148,6 +2147,7 @@ test_arglist \
test_visual \
test_window_cmd \
test_window_id \
test_writefile \
test_alot_latin \
test_alot_utf8 \
test_alot:
Expand Down
10 changes: 5 additions & 5 deletions src/testdir/Make_all.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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.
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down
34 changes: 0 additions & 34 deletions src/testdir/test_marks.in

This file was deleted.

16 changes: 0 additions & 16 deletions src/testdir/test_marks.ok

This file was deleted.

26 changes: 26 additions & 0 deletions src/testdir/test_marks.vim
Original file line number Diff line number Diff line change
@@ -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
34 changes: 0 additions & 34 deletions src/testdir/test_nested_function.in

This file was deleted.

6 changes: 0 additions & 6 deletions src/testdir/test_nested_function.ok

This file was deleted.

32 changes: 32 additions & 0 deletions src/testdir/test_nested_function.vim
Original file line number Diff line number Diff line change
@@ -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
19 changes: 0 additions & 19 deletions src/testdir/test_writefile.in

This file was deleted.

5 changes: 0 additions & 5 deletions src/testdir/test_writefile.ok

This file was deleted.

16 changes: 16 additions & 0 deletions src/testdir/test_writefile.vim
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2305,
/**/
2304,
/**/
Expand Down

0 comments on commit 19a1669

Please sign in to comment.