aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
Commit message (Collapse)AuthorAge
* feat(ui): allow to set the highlight namespace per windowbfredl2022-08-17
| | | | | - reimplement 'winhl' in terms of highlight namespaces - check for EOF in screen tests (to indicate a likely crash)
* test: deal with RPC call causing Nvim to exit laterzeertzjq2022-07-19
|
* refactor(tests): introduce testprg()Justin M. Keyes2022-06-25
| | | | | | Also: - Add a describe('shell :!') section to system_spec. - Make the test for #16271 work on systems without powershell.
* fix: make_filter_cmd for :! powershell #15913Enan Ajmain2022-06-25
| | | | | | | | | | | | | Problem: Nvim fails to create tempfile "…/nvim6UJx04/7" when 'shell' is set to pwsh (PowerShell Core). This breaks filtered shell commands ":{range}!". With shell set to cmd, it works. Solution: PowerShell doesn't use "<" for stdin redirection. Instead, use "-RedirectStandardInput". Closes #15913
* feat(server): instance "name", store pipes in stdpath(state)Justin M. Keyes2022-06-15
| | | | | | | | | | | | | | | | | | Problem: - Unix sockets are created in random /tmp dirs. - /tmp is messy, unclear when OSes actually clear it. - The generated paths are very ugly. This adds friction to reasoning about which paths belong to which Nvim instances. - No way to provide a human-friendly way to identify Nvim instances in logs or server addresses. Solution: - Store unix sockets in stdpath('state') - Allow --listen "name" and serverstart("name") to given a name (which is appended to a generated path). TODO: - is stdpath(state) the right place?
* feat(logging): include test-id in log messagesJustin M. Keyes2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. Log messages (especially in CI) are hard to correlate with tests. 2. Since b353a5c05f02 #11886, dumplog() prints the logs next to test failures. This is noisy and gets in the way of the test results. Solution: 1. Associate an incrementing id with each test and include it in log messages. - FUTURE: add v:name so Nvim instances can be formally "named"? 2. Mention "child" in log messages if the current Nvim is a child (based on the presence of $NVIM). BEFORE: DBG … 12345 UI: event DBG … 12345 log_server_msg:722: RPC ->ch 1: … DBG … 12345 UI: flush DBG … 12345 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … 23454 UI: stop INF … 23454 os_exit:594: Nvim exit: 0 AFTER: DBG … T57 UI: event DBG … T57 log_server_msg:722: RPC ->ch 1: … DBG … T57 UI: flush DBG … T57 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … T57/child UI: stop INF … T57/child os_exit:594: Nvim exit: 0
* fix(tests): check for EOF on exit of nvim properlybfredl2022-06-13
|
* test: allow running CI without ts parsers installedJames McCoy2022-06-08
|
* feat(defaults): search selection by * and # in visual mode (#18538)yamatsum2022-05-13
|
* feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009Justin M. Keyes2022-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM ------------------------------------------------------------------------ $NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the current process should listen on this address") and a descriptor ("the current process is a child of this address"). This contradiction means the presence of NVIM_LISTEN_ADDRESS is ambiguous, so child Nvim always tries to listen on its _parent's_ socket. This is the cause of lots of "Failed to start server" spam in our test/CI logs: WARN 2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0 WARN 2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0 SOLUTION ------------------------------------------------------------------------ 1. Set $NVIM to the parent v:servername, *only* in child processes. - Now the correct way to detect a "parent" Nvim is to check for $NVIM. 2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes. 3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after server init. 4. Open a channel to parent automatically, expose it as v:parent. Fixes #3118 Fixes #6764 Fixes #9336 Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696 Ref #8696
* refactor(ui): simplify stdin handlingbfredl2022-05-02
|
* feat(test): use nvim_exec in helpers.source() #16064Justin M. Keyes2022-03-27
| | | | | | | | helpers.source() was a hack to work around the lack of anonymous :source. Its "create tempfile" behavior is not a required part of most tests that use it. Some tests still need the old "create tempfile" behavior either because they test SID behavior, or because of missing nvim_exec features: #16071
* test: add VIMRUNTIME variable to the clear functionDundar Göc2022-01-08
| | | | Some of the tests will fail if this isn't explicitly set.
* test: fix running functional tests under gdbserverShreyansh Chouhan2021-09-20
| | | | | | | | | | | It was not possible to run the tests under the gdbserver because we were not closing the old session before starting a new one. This caused the server to not to be able to bind to the given address and crashing the tests. This commit closes the session before starting a new one. Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
* refactor(tests): remove redir_exec #15718Justin M. Keyes2021-09-19
| | | | | | | | | | | Problem - `redir_exec` is obsolete, but it keeps getting used in new tests because people copy existing tests. - Disadvantages of `redir_exec`: - Captures extra junk before the actual error/message that we _want_ to test. - Does not fail on error, unlike e.g. `command()`. Solution - Use new functions like `nvim_exec` and `pcall_err`.
* docs: make Lua docstrings consistent #15255Gregory Anders2021-08-22
| | | | | | | | | | | | The official developer documentation in in :h dev-lua-doc specifies to use "--@" for special/magic tokens. However, this format is not consistent with EmmyLua notation (used by some Lua language servers) nor with the C version of the magic docstring tokens which use three comment characters. Further, the code base is currently split between usage of "--@", "---@", and "--- @". In an effort to remain consistent, change all Lua magic tokens to use "---@" and update the developer documentation accordingly.
* feat(defaults): set nojoinspacesGregory Anders2021-08-17
|
* feat: defaults: set undo points in <C-U> and <C-W> (#15400)Gregory Anders2021-08-16
|
* feat(defaults): map CTRL-L to search highlights, update diffs #15385Gregory Anders2021-08-16
|
* feat(defaults): map Y to y$ #13268Matthieu Coudron2021-08-15
| | | | | | | | | rationale: - consistent with D and Y - long recommended by Vim's own ":help Y" close #13268 close #416 ref #6289
* doc(options): Fix recommended PowerShell config (#14349)Dimitri Tcaciuc2021-07-02
| | | | | | | | | | | Ensure that * Shell uses UTF8 input/output mode * Stderr output is captured, in UTF8 * Program exit codes are correctly captured Update functional test harness and add tests for :make command. Closes #13713
* Refactor(tests): Use os commands in mkdir_p helpershadmansaleh2021-06-30
|
* feat(startup): Source runtime/plugin/**/*.lua at startupshadmansaleh2021-06-11
| | | | | | For opt plugins these files are sourced on `:packadd` * `:runtime` Now can exexute lua files
* tests: make treesitter its own categoryBjörn Linse2021-01-03
|
* ex_getln: add secret charmBjörn Linse2020-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in to this secret world using set wildchar=0 " already the default, but remove if non-zero existing config: set wildcharm=0 now you can map 'wildmode' just like any mode: cnoremap <tab> <c-z> function! Spacey() return getcmdline()[-1:] == "/" ? "\<bs>" : "" endfunc cnoremap <expr> / wildmenumode() ? Spacey()."/<c-z>" : "/" Possibly asked questions: What about backwards compatibility? ==== Just do nothing and your existing 'wildchar' and 'wildcharm' will keep working. Doesn't `<c-z>` mean suspend? ==== Not in cmdline mode. If it would then the recommended wildcharm would not have been `<c-z>` to start with. My config relies on `:<c-z>` being a synonym to `:<nop>`! ==== just no.
* api: add API for themesBjörn Linse2020-11-01
| | | | | | | | | | co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function) orange is sus?? NOVEMBER DAWN erase the lie that is redraw_later()
* A Mudholland Dr. RecastBjörn Linse2020-10-19
| | | | | The commit summary maybe does not make sense, but calling a function that does not wait on anything `wait()` makes even less sense.
* api: multiple decoration providers at onceBjörn Linse2020-10-10
|
* provider: align all foo#Detect() functions #12839Justin M. Keyes2020-09-05
| | | | | | Problem: ruby#Detect() and node#Detect() don't return a [prog, err] pair which means callers must special-case them. Solution: align their return signatures with the perl/pythonx providers.
* healtcheck: use g:perl_host_prog if its set insteadJacques Germishuys2020-09-05
| | | | | | using just 'perl' isn't correct as it may not be the version requested. ditto for 'cpanm', rather go through 'App::cpanminus' to find the latest perl version
* lua: move test helper function, map and filter, to vim.shared moduleHirokazu Hata2020-02-18
|
* mksession: always unix slashes "/" for filepathsJustin M. Keyes2020-01-26
|
* provider/perl: add basic testsJan Edmund Lazo2020-01-20
|
* WinClosed: sort auevents.lua; improve testsJustin M. Keyes2020-01-18
| | | | | - test: reduce verbosity, condense redundancy, improve readability - auevents.lua: keep events sorted by name. ref afd1d412fa91
* test: hoist buf_lines()Justin M. Keyes2020-01-08
|
* ci: test powershell core on LinuxJan Edmund Lazo2019-12-31
|
* Merge pull request #7202 from teto/jobstart_envJames McCoy2019-12-13
|\ | | | | [RFC] override environment for jobstart
| * test: always pass a string to expect_msg_seqMatthieu Coudron2019-12-03
| | | | | | | | Seems like pcall doesn't always return a string as a 2nd element of the tuple.
* | defaults: set nostartofline (#11135)Justin M. Keyes2019-12-03
|\ \ | |/ |/| | | | | | | Having the cursor change column can be surprising. Force startofline in functional and old tests. Remove the functional breakindent test, as it's a subset of the oldtest one.
| * defaults: set nostartoflineMatthieu Coudron2019-12-03
| | | | | | | | | | | | | | Having the cursor change column can be surprising. Force startofline in functional and old tests. Remove the functional breakindent test, as it's a subset of the oldtest one.
* | API: rename nvim_execute_lua => nvim_exec_luaJustin M. Keyes2019-12-02
|/ | | | | | - We already find ourselves renaming nvim_execute_lua in tests and scripts, which suggests "exec" is the verb we actually want. - Add "exec" verb to `:help dev-api`.
* build/doc/CI: remove/update quickbuild references #11258Justin M. Keyes2019-10-19
|
* test/functional: retry/Screen: failure instead of error #11173Daniel Hahler2019-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Running out of retries, or unexpected screen state should make the test FAIL, not ERROR. - Uses levels to report the location of the caller. - Improve message with retry-failure (formatting). Before: [ RUN ] test: 103.53 ms ERR test/functional/helpers.lua:388: retry() attempts: 1 test/functional/ui/screen.lua:587: Row 1 did not match. Expected: |*X^ | |{0:~ }| |{0:~ }| | | Actual: |*^ | |{0:~ }| |{0:~ }| | | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/helpers.lua:388: in function 'retry' test/functional/test_spec.lua:24: in function <test/functional/test_spec.lua:23> After: [ RUN ] test: 105.22 ms FAIL test/functional/test_spec.lua:24: stopping after 1 retry() attempts. test/functional/test_spec.lua:25: Row 1 did not match. Expected: |*X^ | |{0:~ }| |{0:~ }| | | Actual: |*^ | |{0:~ }| |{0:~ }| | | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/helpers.lua:389: in function 'retry' test/functional/test_spec.lua:24: in function <test/functional/test_spec.lua:23>
* test: "!:&" works with powershell #11201Jan Edmund Lazo2019-10-10
| | | Removed 'echo' alias because it does not behave like POSIX echo.
* doc: update shellquote for powershell #11122Jan Edmund Lazo2019-10-10
| | | shellquote is not treated like shellxquote for non-quote values.
* tests/functional: keep $TMPDIR in env (#11163)Daniel Hahler2019-10-06
|
* screen: don't crash on invalid grid cells being recomposedBjörn Linse2019-09-30
|
* Context: rename "buflist" => "bufs"Justin M. Keyes2019-09-14
| | | | | Given the other type names "jumps", "vars", etc., the name "buflist" is somewhat unintuitive.
* tests: fix system_spec when run with clipboard manager (#10956)Daniel Hahler2019-09-12
| | | | | | | | | * tests: move os_kill to functional helpers * tests: fix system_spec when run with clipboard manager Replaces "xclip" with a dedicated helper program. Fixes: https://github.com/neovim/neovim/issues/4900#issuecomment-501866842
* update tests for new resize behavior (resize at pager, but not at :!cmd)Björn Linse2019-09-08
|