comparison src/testdir/test_system.vim @ 18197:78d4902b22df v8.1.2093

patch 8.1.2093: MS-Windows: system() test fails Commit: https://github.com/vim/vim/commit/9be0e0b9d31e42d0074527a7789836087475142a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 28 16:25:00 2019 +0200 patch 8.1.2093: MS-Windows: system() test fails Problem: MS-Windows: system() test fails. Solution: Expect CR when using systemlist().
author Bram Moolenaar <Bram@vim.org>
date Sat, 28 Sep 2019 16:30:03 +0200
parents a81f0c936112
children 85160a3649b9
comparison
equal deleted inserted replaced
18196:3bf0235443ac 18197:78d4902b22df
10 call assert_equal(['123'], systemlist('cat', '123')) 10 call assert_equal(['123'], systemlist('cat', '123'))
11 call assert_equal(["as\<NL>df"], systemlist('cat', ["as\<NL>df"])) 11 call assert_equal(["as\<NL>df"], systemlist('cat', ["as\<NL>df"]))
12 else 12 else
13 call assert_equal("123\n", system('echo 123')) 13 call assert_equal("123\n", system('echo 123'))
14 call assert_equal(["123\r"], systemlist('echo 123')) 14 call assert_equal(["123\r"], systemlist('echo 123'))
15 call assert_equal("123", system('more', '123')) 15 call assert_equal("123\n", system('more', '123'))
16 call assert_equal(["123"], systemlist('more', '123')) 16 call assert_equal(["123\r"], systemlist('more', '123'))
17 call assert_equal(["as\<NL>df"], systemlist('more', ["as\<NL>df"])) 17 call assert_equal(["as\r", "df\r"], systemlist('more', ["as\<NL>df"]))
18 endif 18 endif
19 19
20 if !executable('cat') || !executable('wc') 20 if !executable('cat') || !executable('wc')
21 return 21 return
22 endif 22 endif
60 if !has('win32') 60 if !has('win32')
61 let out = systemlist('cat', bufnr('%')) 61 let out = systemlist('cat', bufnr('%'))
62 call assert_equal(['asdf', "pw\<NL>er", 'xxxx'], out) 62 call assert_equal(['asdf', "pw\<NL>er", 'xxxx'], out)
63 else 63 else
64 let out = systemlist('more', bufnr('%')) 64 let out = systemlist('more', bufnr('%'))
65 call assert_equal(['asdf', "pw\<NL>er", 'xxxx'], out) 65 call assert_equal(["asdf\r", "pw\r", "er\r", "xxxx\r"], out)
66 endif 66 endif
67 bwipe! 67 bwipe!
68 68
69 call assert_fails('call system("wc -l", 99999)', 'E86:') 69 call assert_fails('call system("wc -l", 99999)', 'E86:')
70 endfunc 70 endfunc