| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
|
|
|
|
| |
For example, implicitly converting a table to a string works in LuaJIT,
but needs to be done explicitly with tostring() in Lua 5.1.
This can cause issues when testing a non-JIT build if eq(), for example,
fails with a table argument. E.g: eq({}, {1}) will not print the details
of the assertion failure, but will instead print a less helpful "string
expected, got table" error.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
- The previous commit lost information in the tests. Instead, add some
more "normalization" substitutions in pcall_err(), so that the general
shape of the stacktrace is included in the asserted text.
- Eliminate contains(), it is redundant with matches()
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
a bit of test cleanup
ärrår
feeel
SPLIT
fix: sned correct updates on <CR>
|
| |
|
| |
|
|
|
|
|
| |
Whenever `eq()`, `ok()`, etc. fails, include log tail in the failure
message. This helps to correlate log messages with a particular test
failure.
|
| |
|
|
|
|
|
|
| |
This will help debug CI flakey failures.
TODO: helpers.assert_log() -- Explicitly check contents of the logfile.
|
|
|
|
|
|
|
|
| |
- Add vim variable meta accessors: vim.env, vim.{g,v,w,bo,wo}
- Redo gen_char_blob to generate multiple blobs instead of just one
so that multiple Lua modules can be inlined.
- Reorder vim.lua inclusion so that it can use previously defined C
functions and utility functions like vim.shared and vim.inspect things.
- Inline shared.lua into nvim, but also keep it available in runtime.
|
|
|
|
| |
ref #11271
|
| |
|
| |
|
|
|
|
| |
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
|
|
|
|
|
|
|
| |
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
expected.
|
|
|
|
|
| |
- Move os_name() up to "global helpers".
- Rename it to is_os().
- Make it depend on uname() instead of a running Nvim instance.
|
|
|
|
|
|
| |
luassert uses 3 by default, which is often not enough.
Instead of documenting how to increase it, let's use a more fitting
(sane) default of 100 levels.
|
| |
|
|
|
|
|
|
|
|
|
| |
Before:
[ ERROR ] test/functional/helpers.lua @ 812: after_each
test/helpers.lua:156: assertion failed!
stack traceback:
test/helpers.lua:156: in function 'check_logs'
test/functional/helpers.lua:816: in function <test/functional/helpers.lua:812>
|
|
|
|
|
|
| |
Some terminals helpfully translate \n to \r.
fix #10872
ref #10223
|
|
|
|
|
|
| |
Ref: https://github.com/neovim/neovim/pull/10768#discussion_r315904175
Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
|
| |
|
|
|
|
|
|
| |
This is meant to help with test failures where e.g. `busted` itself might
crash or get killed.
Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069
|
|
|
|
|
|
| |
Benefits:
- less lines, especially less results when grepping
- makes it clearer what is exported
|
|
|
|
| |
deepcopy() was duplicated in test/helpers.lua
|
|
|
|
|
| |
Use `tbl_` prefix for all table-util functions. Specify in the function
docstring if it expects a list-like or map-like table.
|
|
|
|
|
|
|
|
|
|
| |
This is where "pure functions" can live, which can be shared by Nvim and
test logic which may not have a running Nvim instance available.
If in the future we use Nvim itself as the Lua engine for tests, then
these functions could be moved directly onto the `vim` Lua module.
closes #6580
|
|
|
|
|
|
|
|
| |
Automatically include all "global helper" util functions in the
unit.helpers and functional.helpers and modules. So tests don't need to
expicitly do:
local global_helpers = require('test.helpers')
|
|
|
|
|
| |
We already do this for _invalid_ async requests #9300.
Now we also do it for failed invocation of valid requests.
|
|
|
|
| |
The deps cache does not work for MSVC builds because the MINGW builds
ovewrite it. Cache saves 10+ minutes on the build.
|
|
|
|
| |
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
Note: the test fails on non-Windows CI (Travis linux, Quickbuild bsd):
even on master before the env.c changes in this patch-series.
Maybe the unix part of printenv-test.c needs to be revisited.
Signed-off-by: Justin M. Keyes <justinkz@gmail.com>
|
|
|
|
|
| |
close #9515
ref #9280
|
|
|
|
| |
make Screen explicitly tied to its session
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tmpdir_get() may be an absolute path, but we invoke glob() with
a relative `initial_path`.
That can lead to this error:
[ ERROR ] test/functional/helpers.lua @ 752: after_each
test/helpers.lua:95: cannot open ./Xtest-tmpdir/nvim8jKCjR: No such file or directory
stack traceback:
test/helpers.lua:95: in function 'glob'
test/helpers.lua:273: in function 'check_cores'
test/functional/helpers.lua:757: in function <test/functional/helpers.lua:752>
|
|
|
|
| |
With DEBUG-level logging, after `make test`, log file could be 1+ GB.
|
|
|
|
|
|
| |
Do this at the test-framework level instead of CI (Travis) scripts.
Then it works for QuickBuild and AppVeyor.
ref eb6dd3e42dc38460e8624dc5faef894e21c6aa26
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
closes #8362
Vim's code calls `call_shell` directly from `get_system_output_as_rettv`
whereas in Nvim this function has been rewritten to not call `call_shell` but to call
`os_system` via `do_os_system`, losing the support for profiling and verbose.
Changing the code to call `call_shell` from `get_system_output_as_rettv`
seems to be too complicated to be worth it on the current version of the
code. So this commit duplicates the relevant code.
|
|
|
|
| |
node.js client uses lodash which has core.js.
|
| |
|
|\ |
|
| |
| |
| | |
other cleanup, ref #8245
|