comparison src/testdir/test_compiler.vim @ 19348:b6da81589f8c v8.2.0232

patch 8.2.0232: the :compiler command causes a crash Commit: https://github.com/vim/vim/commit/165315584d6587e287f54d6c8820e050114b5694 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 8 16:00:46 2020 +0100 patch 8.2.0232: the :compiler command causes a crash Problem: The :compiler command causes a crash. (Daniel Steinberg) Solution: Do not use the script index if it isn't set.
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Feb 2020 16:15:04 +0100
parents 2f0f308c069c
children 165d5890e411
comparison
equal deleted inserted replaced
19347:11bb83791081 19348:b6da81589f8c
1 " Test the :compiler command 1 " Test the :compiler command
2 2
3 source check.vim 3 source check.vim
4 source shared.vim
4 5
5 func Test_compiler() 6 func Test_compiler()
6 if !executable('perl') 7 if !executable('perl')
7 return 8 return
8 endif 9 endif
46 call assert_match(runtime .. '/compiler/ant.vim$', a[0]) 47 call assert_match(runtime .. '/compiler/ant.vim$', a[0])
47 call assert_match(runtime .. '/compiler/bcc.vim$', a[1]) 48 call assert_match(runtime .. '/compiler/bcc.vim$', a[1])
48 call assert_match(runtime .. '/compiler/xmlwf.vim$', a[-1]) 49 call assert_match(runtime .. '/compiler/xmlwf.vim$', a[-1])
49 endfunc 50 endfunc
50 51
52 " Test executing :compiler from the command line, not from a script
53 func Test_compiler_commandline()
54 call system(GetVimCommandClean() .. ' --not-a-term -c "compiler gcc" -c "call writefile([b:current_compiler], ''XcompilerOut'')" -c "quit"')
55 call assert_equal(0, v:shell_error)
56 call assert_equal(["gcc"], readfile('XcompilerOut'))
57
58 call delete('XcompilerOut')
59 endfunc
60
51 func Test_compiler_completion() 61 func Test_compiler_completion()
52 call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx') 62 call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
53 call assert_match('^"compiler ant bcc .* xmlwf$', @:) 63 call assert_match('^"compiler ant bcc .* xmlwf$', @:)
54 64
55 call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx') 65 call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx')