aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shell/viml_system_spec.lua
Commit message (Collapse)AuthorAge
* test: system(): backgrounded shell commandJustin M. Keyes2016-10-19
| | | | | | | | | | | | | | | These tests are essentially affirming a regression vs Vim. In Vim, :echo system('cat - &', 'foo') returns "foo", because Vim internally wraps the command with shell-specific syntax to redirect the streams from /dev/null[1]. That can't work in Nvim because we use pipes directly (instead of temp files) and don't wrap the command with shell-specific redirection syntax. References #3529 References #5241 [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
* Mark some functional tests as pending in WindowsRui Abreu Ferreira2016-08-26
|
* functests: Do not use setup/teardown where before_/after_each is neededZyX2016-06-10
| | | | | | | | | | | | | | | | | | | | | | When skipping these test blocks they may error out: Error → test/functional/shell/viml_system_spec.lua @ 154 system() with output containing NULs setup ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value) stack traceback: ./test/functional/helpers.lua:75: in function 'request' ./test/functional/helpers.lua:166: in function 'nvim_feed' ./test/functional/helpers.lua:195: in function 'feed' test/functional/shell/viml_system_spec.lua:14: in function <test/functional/shell/viml_system_spec.lua:13> Error → test/functional/shell/viml_system_spec.lua @ 155 system() with output containing NULs teardown ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value) stack traceback: ./test/functional/helpers.lua:75: in function 'eval' test/functional/shell/viml_system_spec.lua:21: in function <test/functional/shell/viml_system_spec.lua:20>
* functests: Check logs in lua codeZyX2016-06-10
| | | | | | It is otherwise impossible to determine which test failed sanitizer/valgrind check. test/functional/helpers.lua module return was changed so that tests which do not provide after_each function to get new check will automatically fail.
* test/functional: clean up according to luacheck (part 1)Marco Hinz2015-11-23
|
* test: fix pending() invocationsJustin M. Keyes2015-08-09
| | | | | AFAICT busted does not report pending() invocations without the 2nd argument.
* tests: Use pending() instead of silently skipping test. #2737Florian Walch2015-05-29
|
* unify jobstart, termopen, and system interfacesScott Prager2015-05-02
| | | | | | | | | | | | | | | | | For any of these functions, if {cmd} is a string, execute "&shell &shellcmdflag '{cmd}'", or simply {cmd} if it's a list. In termopen(), if the 'name' option is not supplied, try to guess using '{cmd}' (string) or {cmd}[0] (list). Simplify ex_terminal to use the string form of termopen(). termopen: get name from argument Convert list_to_argv to tv_to_argv. Helped-by: Björn Linse <@bfredl> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: Thiago de Arruda <@tarruda>
* messages: Update common instances of Vim to Nvim #2031Michael Reed2015-04-08
|
* test: Only display cursor marker in screen tests if nvim is not busyThiago de Arruda2015-03-16
|
* tests/ui: Also test character at cursorBjörn Linse2015-03-09
|
* test: Add extra screen expectation to prevent race conditionThiago de Arruda2015-02-20
| | | | | This is to ensure ctrl+c is only pressed after the command has started executing in the viml_system_spec.lua system() interrupt test.
* test: Remove unnecessary tests from viml_system_spec.luaThiago de Arruda2015-02-16
| | | | | | The `system` function is never executed with these tests because the ctrl+c is queued with the input string that calls it(The `process_interrupts` function will destroy all previous input when a ctrl+c is found).
* api: always return empty string as api type StringBjörn Linse2015-02-16
|
* test: Remove nondeterminism in systemlist interrupt testsThiago de Arruda2015-02-06
| | | | | | | | | | The systemlist test currently calls the `echo` command which can potentially complete before being interrupted, causing random test failures. Use `yes | xargs` instead. A `yes` invocation that is not piped through `xargs` can produce a huge amount of lines in a very short time, leading memory starvation when the result is being converted into a list. `xargs` ensures only one line of output will be produced while allowing interrupt to be tested.
* Tests for system()/systemlist() when interrupted with CTRL-C.oni-link2015-01-17
|
* systemlist: test empty lines in beginning and middle of outputBjörn Linse2014-12-02
|
* systemlist: add `keepempty` option to preserve final newlineBjörn Linse2014-12-02
|
* Avoid printing an error response when detecting xclip.John Szakmeister2014-11-26
| | | | | | | While we're at, using the slightly more portable `command -v` technique to detect the executable. Also, there's no need to use `io.popen()` if we aren't going to record the path. Instead, let's use the simpler `os.execute()` to detect the presence of xclip.
* test: Refactor functional helpers to use vim_inputThiago de Arruda2014-11-21
| | | | | | | | | | | | | | | | | | | The vim_input function accepts raw terminal input and so is better to emulate real user, especially because it is not deferred as vim_feedkeys. Using this function required a number of changes: - expect() was refactored to use curbuf_contents() - The vim_eval function in request() was moved to curbuf_contents(). For most cases this is enough(we only care for synchronizing api calls with user input when verifying buffer contents). - <C-@>(NUL) is preprocessed before being passed to replace_termcodes. - Legacy test 4 had a bug that only became visible when using vim_input, it is fixed now. - An extra blank line deletion was required for test 101 The last two items show that vim_feedkeys because it is not 100% equivalent to receiving terminal input.
* shell: Use job_write_cb for closing stdinThiago de Arruda2014-11-10
| | | | | | | | | | Commit @45525853d352 removed usage of the `job_write_cb` for closing stdin due to a memory error, but that doesn't work anymore because `job_close_in` closes stdin immediately, possibly trimming input data before it is fully written. Since most memory issues with jobs have been fixed, re-add the `job_write_cb` call to ensure stdin is only closed when it should. Also add tests for scenarios where using the callback makes a difference.
* eval: Return an empty list from systemlist() when there's no outputThiago de Arruda2014-11-10
| | | | This is the behavior on vim's `systemlist()`.
* test/shell: Add failure tests for `system()`.Scott Prager2014-10-28
|
* job: Refactor to ensure that all callbacks will be invokedThiago de Arruda2014-10-23
| | | | | | | | | | | | | | It's possible that a child process won't close it's standard streams, even after it exits. This can be evidenced with the "xclip" program: :call system('xclip -i -selection clipboard', 'DATA') Before this commit, the above command wouldn't return, even though the xclip program had exited. That is because `xclip` wasn't closing it's stdout/stderr streams, which would block pending_refs from ever reaching 0. Now the job.c module was refactored to ensure all streams are closed when the uv_process_t handle is closed.
* test: verify that v:shell_error is set by `system()`/`systemlist()`Thiago de Arruda2014-10-22
|
* test: Add some specs for the viml function `system()`Thiago de Arruda2014-10-01
These new specs replace src/nvim/testdir/test_system