diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-08 16:00:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-08 16:00:46 +0100 |
commit | 165315584d6587e287f54d6c8820e050114b5694 (patch) | |
tree | e7827dcce0b96c88614b6882236777023834222f /src/testdir/test_compiler.vim | |
parent | d02e508a18346ca1acb8c0c94c38e62a6ddeefe2 (diff) |
patch 8.2.0232: the :compiler command causes a crashv8.2.0232
Problem: The :compiler command causes a crash. (Daniel Steinberg)
Solution: Do not use the script index if it isn't set.
Diffstat (limited to 'src/testdir/test_compiler.vim')
-rw-r--r-- | src/testdir/test_compiler.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim index 4f02cf1c2f..464dd9bcb5 100644 --- a/src/testdir/test_compiler.vim +++ b/src/testdir/test_compiler.vim @@ -1,6 +1,7 @@ " Test the :compiler command source check.vim +source shared.vim func Test_compiler() if !executable('perl') @@ -48,6 +49,15 @@ func Test_compiler_without_arg() call assert_match(runtime .. '/compiler/xmlwf.vim$', a[-1]) endfunc +" Test executing :compiler from the command line, not from a script +func Test_compiler_commandline() + call system(GetVimCommandClean() .. ' --not-a-term -c "compiler gcc" -c "call writefile([b:current_compiler], ''XcompilerOut'')" -c "quit"') + call assert_equal(0, v:shell_error) + call assert_equal(["gcc"], readfile('XcompilerOut')) + + call delete('XcompilerOut') +endfunc + func Test_compiler_completion() call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx') call assert_match('^"compiler ant bcc .* xmlwf$', @:) |