Skip to content

Commit 19a1669

Browse files
committed
patch 7.4.2305
Problem: Marks, writefile and nested function tests are old style. Solution: Turn them into new style tests. (Yegappan Lakshmanan)
1 parent 417ccd7 commit 19a1669

12 files changed

Lines changed: 84 additions & 122 deletions

src/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,12 +2039,9 @@ test1 \
20392039
test_listchars \
20402040
test_listlbr \
20412041
test_listlbr_utf8 \
2042-
test_marks \
2043-
test_nested_function \
20442042
test_search_mbyte \
20452043
test_utf8 \
20462044
test_wordcount \
2047-
test_writefile \
20482045
test2 test3 test4 test5 test6 test7 test8 test9 \
20492046
test11 test12 test13 test14 test15 test17 test18 test19 \
20502047
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
@@ -2105,11 +2102,13 @@ test_arglist \
21052102
test_lispwords \
21062103
test_man \
21072104
test_mapping \
2105+
test_marks \
21082106
test_match \
21092107
test_matchadd_conceal \
21102108
test_matchadd_conceal_utf8 \
21112109
test_menu \
21122110
test_messages \
2111+
test_nested_function \
21132112
test_netbeans \
21142113
test_options \
21152114
test_packadd \
@@ -2148,6 +2147,7 @@ test_arglist \
21482147
test_visual \
21492148
test_window_cmd \
21502149
test_window_id \
2150+
test_writefile \
21512151
test_alot_latin \
21522152
test_alot_utf8 \
21532153
test_alot:

src/testdir/Make_all.mak

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ SCRIPTS_ALL = \
8686
test_autoformat_join.out \
8787
test_breakindent.out \
8888
test_changelist.out \
89-
test_charsearch.out \
89+
test_charsearch.out \
9090
test_close_count.out \
9191
test_command_count.out \
9292
test_comparators.out \
@@ -97,12 +97,9 @@ SCRIPTS_ALL = \
9797
test_insertcount.out \
9898
test_listchars.out \
9999
test_listlbr.out \
100-
test_marks.out \
101-
test_nested_function.out \
102100
test_search_mbyte.out \
103101
test_utf8.out \
104-
test_wordcount.out \
105-
test_writefile.out
102+
test_wordcount.out
106103

107104

108105
# Tests that run on most systems, but not on Amiga.
@@ -175,7 +172,9 @@ NEW_TESTS = test_arglist.res \
175172
test_json.res \
176173
test_langmap.res \
177174
test_man.res \
175+
test_marks.res \
178176
test_matchadd_conceal.res \
177+
test_nested_function.res \
179178
test_netbeans.res \
180179
test_packadd.res \
181180
test_perl.res \
@@ -194,6 +193,7 @@ NEW_TESTS = test_arglist.res \
194193
test_viml.res \
195194
test_visual.res \
196195
test_window_id.res \
196+
test_writefile.res \
197197
test_alot_latin.res \
198198
test_alot_utf8.res \
199199
test_alot.res

src/testdir/test_marks.in

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/testdir/test_marks.ok

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/testdir/test_marks.vim

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
" Test that a deleted mark is restored after delete-undo-redo-undo.
3+
function! Test_Restore_DelMark()
4+
enew!
5+
call append(0, [" textline A", " textline B", " textline C"])
6+
normal! 2gg
7+
set nocp viminfo+=nviminfo
8+
exe "normal! i\<C-G>u\<Esc>"
9+
exe "normal! maddu\<C-R>u"
10+
let pos = getpos("'a")
11+
call assert_equal(2, pos[1])
12+
call assert_equal(1, pos[2])
13+
enew!
14+
endfunction
15+
16+
" Test that CTRL-A and CTRL-X updates last changed mark '[, '].
17+
function! Test_Incr_Marks()
18+
enew!
19+
call append(0, ["123 123 123", "123 123 123", "123 123 123"])
20+
normal! gg
21+
execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX"
22+
call assert_equal("AAA 123 123", getline(1))
23+
call assert_equal("123 XXXXXXX", getline(2))
24+
call assert_equal("XXX 123 123", getline(3))
25+
enew!
26+
endfunction

src/testdir/test_nested_function.in

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/testdir/test_nested_function.ok

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"Tests for nested functions
2+
"
3+
function! NestedFunc()
4+
fu! Func1()
5+
let g:text .= 'Func1 '
6+
endfunction
7+
call Func1()
8+
fu! s:func2()
9+
let g:text .= 's:func2 '
10+
endfunction
11+
call s:func2()
12+
fu! s:_func3()
13+
let g:text .= 's:_func3 '
14+
endfunction
15+
call s:_func3()
16+
let fn = 'Func4'
17+
fu! {fn}()
18+
let g:text .= 'Func4 '
19+
endfunction
20+
call {fn}()
21+
let fn = 'func5'
22+
fu! s:{fn}()
23+
let g:text .= 's:func5'
24+
endfunction
25+
call s:{fn}()
26+
endfunction
27+
28+
function! Test_nested_functions()
29+
let g:text = ''
30+
call NestedFunc()
31+
call assert_equal('Func1 s:func2 s:_func3 Func4 s:func5', g:text)
32+
endfunction

src/testdir/test_writefile.in

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/testdir/test_writefile.ok

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)