Problem: Tests may change the input file when something goes wrong.
Solution: Avoid writing the input file.
:hi Crash term='asdf
:redir END
:" filter ctermfg and ctermbg, the numbers depend on the terminal
-:e test.out
+:e! test.out
:%s/ctermfg=\d*/ctermfg=2/
:%s/ctermbg=\d*/ctermbg=3/
:" filter out possibly translated error message
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
:edit testfile2.test
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
-:e test.out
+:e! test.out
:call append(0, results)
:$d
:w
:set shell=doesnotexist
:" consistent sorting of file names
:set nofileignorecase
-:e test.out
+:e! test.out
:$put =glob('Xxx\{')
:$put =glob('Xxx\$')
:w! Xxx{
0tabnew
1tabnew
$tabnew
+ %del
tabdo call append(line('$'), tabpagenr())
tabclose! 2
tabrewind
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 32,
/**/
31,
/**/