aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
Commit message (Collapse)AuthorAge
...
| * win/test: Enable more system() testsRui Abreu Ferreira2017-04-12
| |
| * test: `:file {name}`Justin M. Keyes2017-04-11
| |
| * test/rmdir(): fallback to Nvim delete()Justin M. Keyes2017-04-11
| | | | | | | | | | | | | | Lua has too many pitfalls here: - os.execute() requires shell-escaping - os.execute() has breaking changes between Lua 5.1 and 5.2 - No native way in Lua to handle "readonly" etc. on Windows
| * test/rmdir(): Remove `readonly` attr on Windows.Justin M. Keyes2017-04-10
| |
* | Merge branch 'master' into luaviml'/luaZyX2017-04-10
|\|
| * Merge branch 'master' into rename-executeZyX2017-04-09
| |\
| | * test: retry(): Report number of retries. (#6475)Justin M. Keyes2017-04-09
| | | | | | | | | tui_spec.lua: Retry the terminal-mode test.
| * | 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.
| * | functests: Refactor legacy/029_join testZyX2017-04-08
| |/
* | Merge branch 'master' into luaviml'/luaZyX2017-04-08
|\|
| * unittests: Add trace description right to the error messageZyX2017-04-01
| |
| * test: set 'nomore' by default (#6360)Matthew Malcomson2017-03-30
| | | | | | | | | | | | Escaping from a '-- More --' prompt in tests is awkward as it doesn't take keys from the typebuffer, requiring a call to `feed()` in lua at the correct time. Moreover, it's rarer that a test will want the '-- More --' prompt to be activated than not.
| * functests: Fix buf_functions test on WindowsZyX2017-03-29
| |
* | functests: Fix “function has more then 60 upvalues” errorZyX2017-03-27
|/
* defaults: 'showcmd', 'belloff', 'ruler'Justin M. Keyes2017-03-16
| | | | | | | | | | | - Vim "unix default" of 'noshowcmd' is serving few users. And it's inconsistent. - 'ruler' and 'belloff=all' improve the out-of-the-box experience. - Continue to use 'noshowcmd' and 'noruler' by default in the functional tests to keep them fast. TODO: Add a "disable slow stuff" command or mapping to address the use-case of a very slow terminal connection.
* test: Refactor fold tests (#5993)Matthieu Coudron2017-02-28
|
* Merge #6112 from ZyX-I/split-eval'/buf_get_changedtickJustin M. Keyes2017-02-27
|\ | | | | Better b:changedtick support
| * api: Make sure dict_set_var doesn’t edit read-only valuesZyX2017-02-23
| | | | | | Fixes #6147
* | Merge #6111 from ZyX-I/split-eval'/os-fileioJustin M. Keyes2017-02-27
|\ \ | |/ |/| Refactor writefile() and create more tests for it
| * eval: writefile: Give more adequate IO errors and do not call putc()ZyX2017-02-14
| |
* | ci: Better core dump checkingZyX2017-02-14
|/ | | | | | | | | | | | | | | | - Do not exclude any directories from `find` search, remove dumps before tests instead. - Install `apport` on travis so that linux tests should produce core dumps (based on information from travis-ci/travis-ci#3754, not sure whether it still applies). - Check cores in lua so that one has an idea which test is failing exactly. Do this only 10% of time on linux because traversing the file system is slow. Unit tests are still not touched, though it is what `app` argument in `check_cores` is for. TODO? consider using `find`, it may be faster. Consider retiring `os.execute`, dealing with escaping is bad.
* build: `oldtest` target: TEST_FILE, NVIM_PRG (#6098)Justin M. Keyes2017-02-12
| | | | | | | | | | | | | | | | | | | | | | - Add support for TEST_FILE to the `oldtest` target, for consistency with the busted/lua tests. Caveat: with the busted/lua tests TEST_FILE takes a full path, whereas for `oldtest` it must be "test_foo.res". - Add support for NVIM_PRG, again so that all test-related targets are consistent. - Use consistent name for NVIM_PRG. But still need to support NVIM_PROG for QuickBuild CI. Note: The `oldtest` target is driven by the top-level Makefile, because it requires a TTY. CMake 3.2 added a USES_TERMINAL flag to add_custom_target(). But we support CMake 2.8... add_custom_target(oldtest COMMAND make clean COMMAND make NVIM_PRG=$<TARGET_FILE:nvim> $ENV{MAKEOVERRIDES} DEPENDS nvim WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/testdir" USES_TERMINAL true )
* test: helpers.clear(): Set common env vars only if not passed.Justin M. Keyes2017-02-04
|
* undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)Matthew Malcomson2017-01-31
| | | | | | | | | | | | | | | | | | | Previously alternate branches were not accounted for properly, with this change g- after an undo to a branch point works. The current sequence number b_u_seq_cur is used in undo_time(), in u_doit() this was calculated by subtracting one from the curhead sequence number. The curhead header entry represents the change that was just undone, so the sequence number we want is that of the change we have moved to. This is the sequence number of the undo head that is the uh_next element of this curhead. That sequence number is not always one less than the curhead sequence number -- there may have been an alternate branch at this point. Instead of subtracting one, we now directly find the sequence number of curhead->uh_next.
* test: Avoid Lua closure limit.Justin M. Keyes2017-01-22
| | | | | Fixes Lua error: > function at line 543 has more than 60 upvalues
* Merge #5782 'Visual-mode put from @. register'Justin M. Keyes2017-01-22
|\
| * put fixup, esp. ". register close #5709 #5781Matthew Malcomson2017-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note some bugs were judged to have too ugly a fix to solve, tests to demonstrate these problems, and the explanation behind not fixing them are below. describe('register . problems', function() before_each(reset) -- The difficulty here is: The basic requirement is that the text -- inserted is treated as if it were typed in insert mode. This is why -- the paste method is to enter insert mode and enter the ". register -- into readbuf1. -- We can't add a count into the readbuf here because the insert mode -- count is implemented with readbuf2 which is checked for characters -- after readbuf1. -- Hence, the ".gp command (which adds extra characters into readbuf1 -- to emulate leaving the cursor after the text by moving the cursor -- after inserting the text) would insert the motion characters into -- the buffer instead of using them to move after the insert has been -- done. -- I could probably get this working properly with a special flag put -- into start_redo_ins() and set in do_put(), but I think this adds -- much more complexity than fixing this bug justifies. pending('should not change the ". register with ".2p', function() local orig_register = funcs.getreg('.') feed('2".p') eq(orig_register, funcs.getreg('.')) end) describe("cursor positioning after undo and redo with '.'", function() before_each(reset) local function make_cursor_test(macro_string) return function() feed(macro_string) local afterpos = funcs.getcurpos() local orig_string = curbuf_contents() feed('u.') eq(afterpos, funcs.getcurpos()) expect(orig_string) end end -- The difficulty here is: setting the cursor after the end of the -- pasted text is done by adding a motion command to the -- stuffbuffer after the insert. -- Modifying 'redobuff' is done in the code that handles inserting -- text and moving around. -- I could add a special case in ins_esc() that checks for a flag -- set in do_put() to add the motion character to the redo buffer, -- but I think that is starting to get way too convoluted for the -- benefit. pending('should be the same after ".gp and ".gpu.', make_cursor_test('".gp')) -- The difficulty here is: putting forwards is implemented by using -- 'a' instead of 'i' to start insert. -- Undoing with 'u' an insert that began with 'a' leaves the cursor -- where the first character was inserted, not where the cursor was -- when the 'a' was pressed. -- We account for this the first time by saving the cursor position -- in do_put(), but this isn't stored in redobuff for a second time -- around. -- We can't change how such a fundamental action as undo after -- inserting with 'a' behaves, we could add in a special case -- whereby we set a flag in do_put() and read it when entering -- insert mode but this seems like way too much to fix such a minor -- bug. pending('should be the same after ".pu. and ".pu.u.', make_cursor_test('".pu.')) end) end)
* | win: test: enable job_spec.luaJustin M. Keyes2017-01-19
|/ | | | | | | | | | - Default to powershell. - Avoid hardcoded "-c". - Remove ^M character from received lines. - pending_win32(): clear() is unnecessary and it pollutes the tests. Closes #3973 Helped-by: Rui Abreu Ferreira <raf-ep@gmx.com>
* Windows: enable more testsJustin M. Keyes2017-01-13
|
* Merge #5749 from justinmk/test-ctrl-cJustin M. Keyes2017-01-04
|\
| * test: skip_fragile(), TEST_SKIP_FRAGILEJustin M. Keyes2017-01-04
| | | | | | | | | | | | | | Let build systems define TEST_SKIP_FRAGILE to skip tests that are known to be resource-intensive (unreliable on slow systems). References https://github.com/neovim/neovim/pull/5488#issuecomment-265622113
* | Merge #5872 justinmk/test_autochdirJustin M. Keyes2017-01-04
|\ \
| * | test/helpers.rmdir(): Windows: Change to top-level dir on failure.Justin M. Keyes2017-01-04
| |/ | | | | | | | | | | On Windows, if the nvim process has a directory open the lua process cannot remove it. After failing once, it's safe to force `nvim` to the top-level directory. Then try again.
* / unittest: Allow multiple indirect includesZyX2017-01-03
|/ | | | | | | | | | Works by saving all preprocessor defines and reusing them on each run. This also saves NVIM_HEADER_H defines. Saving other defines is needed for defines like `Map(foo, bar)` which are sometimes used to declare types or functions. Saving types or function declarations is not needed because they are recorded as luajit state. Fixes #5857
* eval.c: set_selfdict(): Fix invalid memory access.Justin M. Keyes2016-12-14
|
* test: helpers.retry()Justin M. Keyes2016-12-07
|
* test/api: Specify handling of VimL errors, v:errmsg.Justin M. Keyes2016-10-24
| | | | TODO: Also spec behavior of Press-Enter prompt for these API functions.
* api: documentationJustin M. Keyes2016-10-23
| | | | Clarify behavior of v:errmsg and the Error object.
* test: api_specJustin M. Keyes2016-09-22
| | | | | This is an (unsuccessful) attempt to cover #4163. It covers other behavior, so it's worth keeping.
* test/helpers.rmdir(): lfs.rmdir() instead of os.remove()Justin M. Keyes2016-09-20
| | | | | | | | | os.remove() fails on empty directories in non-POSIX systems. https://github.com/keplerproject/luafilesystem/issues/4 lfs.rmdir() "usually" works, so use it instead. Closes #5236
* test/helpers.rmdir(): Retry once after a delay.Justin M. Keyes2016-09-20
| | | | | Attempt to avoid "Permission denied" on Windows potentially caused by open filepath handle in sibling process.
* api: Establish API naming convention. (#5344)Justin M. Keyes2016-09-17
| | | | | | | | | | | | | | | | | | | | | old name: new name: -------------------------------------------------- nvim_name_to_color nvim_get_color_by_name nvim_get_current_buffer nvim_get_current_buf nvim_get_current_window nvim_get_current_win nvim_get_buffers nvim_list_bufs nvim_get_tabpages nvim_list_tabpages nvim_get_windows nvim_list_wins nvim_set_current_buffer nvim_set_current_buf nvim_set_current_window nvim_set_current_win nvim_change_directory nvim_set_current_dir nvim_tabpage_get_window nvim_tabpage_get_win nvim_tabpage_get_windows nvim_tabpage_list_wins nvim_win_get_buffer nvim_win_get_buf nvim_report_error nvim_err_writeln Helped-by: Björn Linse <bjorn.linse@gmail.com> Helped-by: ZyX <kp-pav@yandex.ru> Helped-by: James McCoy <jamessan@jamessan.com>
* api: consistently use nvim_ prefix and update documentationBjörn Linse2016-08-31
|
* Merge pull request #5225 from equalsraf/windows-functionaltestsBjörn Linse2016-08-31
|\ | | | | Enable functional tests in Appveyor
| * functionaltest: Create lua helper for os.tmpname()Rui Abreu Ferreira2016-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Windows Lua's os.tmpname() returns relative paths starting with \s, prepend them with $TEMP to generate a valid path. In OS X os.tmpname() returns paths in '/tmp' but they should be in '/private/tmp'. We cannot use os_name() for platform detection because some tests use tempname() before nvim is spawned, instead use one of the following: 1. Set SYSTEM_NAME environment variable before calling the tests, it is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows') 2. Call uname -s 3. Assume windows
| * Mark some functional tests as pending in WindowsRui Abreu Ferreira2016-08-26
| |
* | api/ui: add tests for popupmenu_external eventsBjörn Linse2016-08-29
|/ | | | update screen.lua to use new style nvim_ui_attach
* tests: Set env variables in RunTests.cmakeTommy Allen2016-08-17
| | | | | | - NVIM_RPLUGIN_MANIFEST - XDG_CONFIG_HOME - XDG_DATA_HOME
* functests: Add tests for XDG defaultsZyX2016-07-10
|