aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/system_spec.lua
Commit message (Collapse)AuthorAge
* os_system(): do not set up input stream for empty string #7951Justin M. Keyes2018-02-01
| | | | | | | | | Test failure: test/functional/eval/system_spec.lua: "works with an empty string" E5677: Error writing input to shell-command: EPIPE ref https://github.com/neovim/neovim/pull/6558#issuecomment-361061035 ref #6554
* eval: save_tv_as_string: Correctly handle an empty stringJames McCoy2018-01-23
| | | | | | | | When tv_get_string_chk returns a non-NULL value, we have a valid string. Propagating an error state (*len = -1, NULL return) for an empty string is invalid. Closes #6554
* test: system(): fix testJustin M. Keyes2018-01-23
| | | | | | | For the test to be valid it should actually send input. ref #3529 ref #5241
* vim-patch:8.0.0151,3,4 #7389Justin M. Keyes2018-01-15
| | | | | | | | | | | | | | | | | | | vim-patch:8.0.0151 Problem: To pass buffer content to system() and systemlist() one has to first create a string or list. Solution: Allow passing a buffer number. (LemonBoy, closes vim/vim#1240) https://github.com/vim/vim/commit/12c4492dd35e0cd83c8816be2ec849b836109882 vim-patch:8.0.0153 Problem: system() test fails on MS-Windows. Solution: Deal when extra space and CR. https://github.com/vim/vim/commit/9d9c35651712b88c81f1ae11091de1fd0bbbd35c vim-patch:8.0.0154 Problem: system() test fails on OS/X. Solution: Deal with leading spaces. https://github.com/vim/vim/commit/31f19ce0a052f7c76d44a9a190e468c79cf5d56d
* test: win: yes is unavailable on WindowsJan Edmund Lazo2018-01-06
|
* win: test: check non-shell system()Jan Edmund Lazo2018-01-06
|
* test: use unix fileformat to test NULs on systemlistJan Edmund Lazo2018-01-06
|
* win: default shellxescape, shellxquote to emptyRui Abreu Ferreira2017-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling cmd.exe in Windows follows a very different pattern from Vim. The primary difference is that Vim does a nested call to cmd.exe, e.g. the following call in Vim system('echo a 2>&1') spawns the following processes "C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1 ^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1) C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1 ^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1) C:\Windows\system32\cmd.exe /c (echo a 2>&1 >C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1) The escaping with ^ is needed because cmd.exe calls itself and needs to preserve the special metacharacters for the last call. However in nvim no nested call is made, system('') spawns a single cmd.exe process. Setting shellxescape to "" disables escaping with ^. The previous default for shellxquote=( wrapped any command in parenthesis, in Vim this is more meaningful due to the use of tempfiles to store the output and redirection (also see &shellquote). There is a slight benefit in having the default be empty because some expressions that run in console will not run within parens e.g. due to unbalanced double quotes system('echo "a b')
* win: libuv_process_spawn(): special-case cmd.exeRui Abreu Ferreira2017-04-12
| | | | | | | | | | | | | | | | | | Disable CommandLineToArgvW-standard quoting for cmd.exe. libuv assumes spawned processes follow the convention expected by CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe: - With system([]), the caller has full control (and responsibility) to quote arguments correctly. - With system(''), shell* options are used. libuv quoting is disabled if argv[0] is: - cmd.exe - cmd - $COMSPEC resolving to a path with filename cmd.exe Closes #6329 References #6387
* win/test: Enable more system() testsRui Abreu Ferreira2017-04-12
|
* functests: Fix some tests which are failing locally for unrelated reasonsZyX2017-04-09
|
* functests: Replace execute with either command or feed_commandZyX2017-04-09
| | | | | | | | | | Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed.
* test: Turn printargs_path into a functionJames McCoy2017-02-02
| | | | | | | | | | When test/functional/eval/system_spec.lua is run on its own, helpers.os_name() was being called before a session had been created. This caused that describe block to fail. Turning printargs_path into a function delays the call of helpers.os_name() until the test is being run, which ensures a session is available.
* test: Make xclip exit after one selection requestJames McCoy2017-02-02
| | | | Closes #4900
* test: system([...]): v:shell_errorJustin M. Keyes2017-01-11
|
* system([...]): Set v:shell_error=-1 if not executable.Rui Abreu Ferreira2017-01-11
| | | | | | | | Do _not_ set v:shell_error on parameter validation error. system([...]) does not invoke a shell, so this change is somewhat questionable. But `:help v:shell_error` is sufficiently vague to allow -1 in this case.
* test: system([...])Rui Abreu Ferreira2017-01-11
|
* test: system(): Avoid indeterminism.Justin M. Keyes2016-10-23
|
* system('foo &', 'bar'): Show error, don't crash.Justin M. Keyes2016-10-19
Closes #3529 Closes #5241 In Vim, :echo system('cat - &', 'foo') works because for both system() and :! Vim writes input to a temp file and uses shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output() .. make_filter_cmd()). In Nvim, :echo system('cat - &', 'foo') fails because we write the input directly via pipes (shell.c:do_os_system()), but (per POSIX[1]) backgrounded process input stream is redirected from /dev/null (unless overridden by shell redirection; supported only by some shells [2]), so our writes are ignored, the process exits quickly, and if we are writing data larger than the buffer size we'll see EPIPE. This still works: :%w !tee > foo1358.txt & but this does not: :%w !tee foo1358.txt & though it *should* (why doesn't it?) because we still do the temp file dance in do_bang() .. do_filter(). [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02 [2] http://unix.stackexchange.com/a/71218