Skip to content

Commit c1ac55b

Browse files
zeertzjqchrisbra
andauthored
vim-patch:9.1.1236: tests: test_comments leaves swapfiles around (neovim#33050)
Problem: tests: test_comments leaves swapfiles around Solution: use ':bw!' instead of ':close!' closes: vim/vim#16955 vim/vim@35cb036 Co-authored-by: Christian Brabandt <cb@256bit.org>
1 parent 5719f2b commit c1ac55b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/old/testdir/test_comments.vim

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Test_comment_nested()
1717
>>>> H
1818
END
1919
call assert_equal(expected, getline(1, '$'))
20-
close!
20+
bw!
2121
endfunc
2222

2323
" Test for the 'b' flag in 'comments'
@@ -36,7 +36,7 @@ func Test_comment_blank()
3636
H
3737
END
3838
call assert_equal(expected, getline(1, '$'))
39-
close!
39+
bw!
4040
endfunc
4141

4242
" Test for the 'f' flag in 'comments' (only the first line has a comment
@@ -50,7 +50,7 @@ func Test_comment_firstline()
5050
setlocal comments=:-
5151
exe "normal i- B\nD\<C-C>ggoC\<C-C>ggOA\<C-C>"
5252
call assert_equal(['- A', '- B', '- C', '- D'], getline(1, '$'))
53-
close!
53+
bw!
5454
endfunc
5555

5656
" Test for the 's', 'm' and 'e' flags in 'comments'
@@ -75,7 +75,7 @@ func Test_comment_threepiece()
7575
setlocal autoindent noexpandtab
7676
call feedkeys("a\t/*\tone\ntwo\n/", 'xt')
7777
call assert_equal(["\t/*\tone", "\t *\ttwo", "\t */"], getline(1, '$'))
78-
close!
78+
bw!
7979
endfunc
8080

8181
" Test for the 'r' flag in 'comments' (right align comment)
@@ -97,7 +97,7 @@ func Test_comment_rightalign()
9797
G
9898
END
9999
call assert_equal(expected, getline(1, '$'))
100-
close!
100+
bw!
101101
endfunc
102102

103103
" Test for the 'O' flag in 'comments'
@@ -112,7 +112,7 @@ func Test_comment_O()
112112
* D
113113
END
114114
call assert_equal(expected, getline(1, '$'))
115-
close!
115+
bw!
116116
endfunc
117117

118118
" Test for using a multibyte character as a comment leader
@@ -185,7 +185,7 @@ func Test_comment_multibyte_leader()
185185
call assert_equal(expected, getline(1, '$'))
186186

187187
set tw& fo& comments&
188-
close!
188+
bw!
189189
endfunc
190190

191191
" Test for a space character in 'comments' setting
@@ -205,7 +205,7 @@ func Test_comment_space()
205205
> H
206206
END
207207
call assert_equal(expected, getline(1, '$'))
208-
close!
208+
bw!
209209
endfunc
210210

211211
" Test for formatting lines with and without comments
@@ -214,7 +214,7 @@ func Test_comment_format_lines()
214214
call setline(1, ['one', '/* two */', 'three'])
215215
normal gggqG
216216
call assert_equal(['one', '/* two */', 'three'], getline(1, '$'))
217-
close!
217+
bw!
218218
endfunc
219219

220220
" Test for using 'a' in 'formatoptions' with comments
@@ -243,7 +243,7 @@ func Test_comment_autoformat()
243243
call assert_equal(['one'], getline(1, '$'))
244244
set backspace&
245245

246-
close!
246+
bw!
247247
endfunc
248248

249249
" Test for joining lines with comments ('j' flag in 'formatoptions')
@@ -262,7 +262,7 @@ func Test_comment_join_lines_fo_j()
262262
call setline(1, ['i++; > ) > ) comment1', ' > ) comment2'])
263263
normal J
264264
call assert_equal('i++; > ) > ) comment1 comment2', getline(1))
265-
close!
265+
bw!
266266
endfunc
267267

268268
" Test for formatting lines where only the first line has a comment.
@@ -277,7 +277,7 @@ func Test_comment_format_firstline_comment()
277277
call setline(1, ['- one', '- two'])
278278
normal gggqG
279279
call assert_equal(['- one', '- two'], getline(1, '$'))
280-
close!
280+
bw!
281281
endfunc
282282

283283
" vim: shiftwidth=2 sts=2 expandtab

0 commit comments

Comments
 (0)