comparison src/testdir/test_system.vim @ 15406:63b02fcf1361 v8.1.0711

patch 8.1.0711: test files still use function! commit https://github.com/vim/vim/commit/1e1153600c0377472d62cc553173fe555ddcf5a7 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 9 23:01:02 2019 +0100 patch 8.1.0711: test files still use function! Problem: Test files still use function!. Solution: Remove the exclamation mark. Fix overwriting a function.
author Bram Moolenaar <Bram@vim.org>
date Wed, 09 Jan 2019 23:15:05 +0100
parents bcab4e804c20
children 4c7097a980a5
comparison
equal deleted inserted replaced
15405:3a8785d45112 15406:63b02fcf1361
1 " Tests for system() and systemlist() 1 " Tests for system() and systemlist()
2 2
3 function! Test_System() 3 func Test_System()
4 if !executable('echo') || !executable('cat') || !executable('wc') 4 if !executable('echo') || !executable('cat') || !executable('wc')
5 return 5 return
6 endif 6 endif
7 let out = system('echo 123') 7 let out = system('echo 123')
8 " On Windows we may get a trailing space. 8 " On Windows we may get a trailing space.
43 call assert_equal(['asdf', "pw\<NL>er", 'xxxx'], out) 43 call assert_equal(['asdf', "pw\<NL>er", 'xxxx'], out)
44 endif 44 endif
45 bwipe! 45 bwipe!
46 46
47 call assert_fails('call system("wc -l", 99999)', 'E86:') 47 call assert_fails('call system("wc -l", 99999)', 'E86:')
48 endfunction 48 endfunc
49 49
50 function! Test_system_exmode() 50 func Test_system_exmode()
51 if has('unix') " echo $? only works on Unix 51 if has('unix') " echo $? only works on Unix
52 let cmd = ' -es -u NONE -c "source Xscript" +q; echo "result=$?"' 52 let cmd = ' -es -u NONE -c "source Xscript" +q; echo "result=$?"'
53 " Need to put this in a script, "catch" isn't found after an unknown 53 " Need to put this in a script, "catch" isn't found after an unknown
54 " function. 54 " function.
55 call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript') 55 call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript')