aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* 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: Fix nondeterminism in tests with notificationsThiago de Arruda2014-11-10
| | | | | | | | Tests which spin the event loop and stop it in a notification handler have a chance of re-entering the event loop due to the `vim_eval` call in the `request()` helper(assuming the request call is what triggered the notification). Since this will cause an error to be thrown by the lua client, don't send the extra `vim_eval` request when the loop has been stopped.
* job_spec: Fix bad test.Scott Prager2014-11-07
|
* job: Let vimL jobsend() accept a list.Scott Prager2014-11-07
| | | | | | | | Use save_tv_as_string(), same as vimL system(). This also makes jobsend() more liberal in what it can accept. For example, `jobsend(j, 123)` is now valid. Closes #1176
* job: Make v:job_data[2] a list.Scott Prager2014-11-07
| | | | | | | | Factor out string_to_list() from f_system()'s implementation and use that to set job_data. This has the technical advantage of preserving NULs, and may be more convenient for users. Required for #1176.
* job: Only force-close stdout/stderr when the job exitsThiago de Arruda2014-11-07
| | | | | stdout/stderr should only be closed after the job truly exits, or else we can lose data sent by it.
* test: Pass --show-possibly-lost=no to valgrind in helpers.luaThiago de Arruda2014-11-07
| | | | | This command-line flag will suppress all warnings about interior pointers, which are used in hashtab.c.
* test: Improve test environment setup and error handling/reportingThiago de Arruda2014-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | During test setup, we used to call a vimscript function(BeforeEachTest) that attempted to restore Nvim to it's initial state as much as possible in order to provide a clean environment for running new tests. This approach has proven to be unreliable, as some tests leave state that can affect other tests, eventually causing failures that are difficult to debug. This commit changes the 'clear' function so it will restart Nvim every time it is called, which is a slower, but more reliable solution that will simplify spotting bugs in the future. Some other improvements/fixes were also performed: - Whenever an error is detected in a handler passed to "run()", the event loop will be stopped and the error will be propagated to the main thread. - Errors and the "cleanup()" function will always send a quit command to the current Nvim instance. This should prevent memory starvation when running tests under valgrind(where each Nvim instance can consume a lot of memory). - Fixed a wrong assertion in server_requests_spec.lua. Previously the failure was undetected in a notification handler. - Fixed some tests to expect fully clean registers. The deleted cleanup function used to put an empty string in every register, but that resulted in a extra line being added.
* channel: Delay notifications to avoid client race conditionsThiago de Arruda2014-11-06
| | | | | | | | | | It is currently possible for a client to send a response that doesn't match the current server->client request(at the top of the stack). This commit fixes that by delaying notifications to until the first `channel_send_call` invocation returns. Also remove the "call stack" size check, vim will already break if the call stack goes too deep.
* test: Simplify/fix options_spec.luaThiago de Arruda2014-11-06
| | | | | | | | | | The options_spec.lua suite has one purpose: Check if the :options commands will throw any exception(:options is implemented by $VIMRUNTIME/optwin.vim). For this it is best to use the `vim_command` API function since it will automatically catch exceptions and forward them via msgpack-rpc. Also, the option window seems to affect other tests, so call `restart` in the teardown hook.
* legacy tests: migrate test21Rainer Borene2014-11-04
|
* legacy tests: migrate test7Rainer Borene2014-11-04
|
* legacy tests: migrate test6Rainer Borene2014-11-04
|
* legacy tests: migrate test28Rainer Borene2014-11-04
|
* legacy tests: migrate test20Rainer Borene2014-11-04
|
* legacy tests: migrate test97Rainer Borene2014-11-04
|
* legacy tests: migrate test46Rainer Borene2014-11-04
|
* legacy tests: migrate test27Rainer Borene2014-11-04
|
* legacy tests: migrate test54Rainer Borene2014-11-04
|
* legacy tests: migrate test41Rainer Borene2014-11-04
|
* legacy tests: migrate test23Rainer Borene2014-11-04
|
* legacy tests: migrate test56Rainer Borene2014-11-04
|
* legacy tests: migrate test_autoformat_joinRainer Borene2014-11-04
|
* legacy tests: migrate test_changelistRainer Borene2014-11-04
|
* legacy tests: migrate test81Rainer Borene2014-11-04
|
* legacy tests: migrate test_utf8Rainer Borene2014-11-04
|
* legacy tests: migrate test_insertcountRainer Borene2014-11-04
|
* legacy tests: migrate test_optionsRainer Borene2014-11-04
|
* legacy tests: migrate test18Rainer Borene2014-11-04
|
* legacy tests: migrate test106Rainer Borene2014-11-04
|
* legacy tests: migrate test22Rainer Borene2014-11-04
|
* legacy tests: migrate test9Rainer Borene2014-11-04
|
* legacy tests: migrate test102Rainer Borene2014-11-04
|
* legacy tests: migrate test4Rainer Borene2014-11-04
|
* legacy tests: improvements to functional helpers.luaRainer Borene2014-11-04
| | | | | | - Clean vim registers and functions before each test - Add eval workaround to the request helper method - Export dedent method
* test/api: add test for set_cursor always updating the screenBjörn Linse2014-11-01
|
* unittest: increase number of retries in cimportStefan Hoffmann2014-10-30
|
* unittest: fix handling of pragma pack in `cimport`Stefan Hoffmann2014-10-30
|
* fix #1027: :wundo segfault in new, non-empty bufferJustin M. Keyes2014-10-26
|
* fix 'sign unplace id'Kartik K. Agaram2014-10-28
| | | | | | | | | | | | Since the introduction of the FOR_ALL_BUFFERS macro, 'sign unplace id' without a buffer was only removing the sign from the first buffer rather than all buffers, as described in the documentation. :help sign-unplace -- modeline discussion: https://github.com/akkartik/neovim/commit/7863c247db#commitcomment-8342590
* test/job: Implement some basic jobs tests.Scott Prager2014-10-28
|
* test/shell: Add failure tests for `system()`.Scott Prager2014-10-28
|
* test: Small fixes and improvements to functional helpers.luaThiago de Arruda2014-10-28
| | | | | | | | - Move the cleanup function definition into `restart()` so restart can be selectively used as a hook - Improve error handling: Before this, errors while running the event loop would cause busted to get stuck. Now the error is properly raised by stopping the event loop first.
* test: verify that msgpacks-rpc exceptions are workingThiago de Arruda2014-10-23
|
* 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.
* legacy tests: migrate test35. #1318Nate Sullivan2014-10-22
| | | | | Migrate vim's integration test 35 (increment/decrement commands) to lua/busted.
* test: verify that v:shell_error is set by `system()`/`systemlist()`Thiago de Arruda2014-10-22
|
* test: Use lua to perform sanity API checksThiago de Arruda2014-10-16
| | | | | | | Sanity API checks made by the python-client in the api-python travis target were converted to lua and will now live in this repository. This will simplify performing breaking changes to the API as it won't be necessary to send parallel PRs the python-client.
* test: Remove run-functional-tests.pyThiago de Arruda2014-10-16
| | | | | | Now that the lua client is available, python/lupa are no longer necessary to run the functional tests. The helper functions previously defined in run-functional-tests.py were adapted to test/functional/helpers.lua.