summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/lua/luaeval_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-20refactor(test): drop deprecated exc_exec #39242Justin M. Keyes1
2025-09-03docs: lsp, miscJustin M. Keyes1
- Problem: It's not clear for new plugin developers that `:help` uses a help-tags file for searching the docs, generated by `:helptags`. - Solution: Hint to the |:helptags| docs for regenerating the tags file for their freshly written documentation. Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-08-31fix(lua): report error in Lua Funcref callback properly (#35555)zeertzjq1
2025-05-06refactor(tests): lint decorations_spec, float_spec, multigrid_spec #33274Justin M. Keyes1
Problem: decorations_spec.lua, float_spec.lua, multigrid_spec.lua are not auto-formatted. Solution: Add a special `formatlua2` cmake target, which invokes `stylua` with an alternative `.stylua2.toml` config.
2025-05-04feat(messages): cleanup Lua error messagesJustin M. Keyes1
"Error" in error messages is redundant. Just provide the context, don't say "Error ...".
2024-11-14fix(tests): needing two calls to setup a screen is cringebfredl1
Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
2024-09-23refactor(api)!: rename Dictionary => DictJustin M. Keyes1
In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
2024-08-14refactor(tests): again yet more global highlight definitionsbfredl1
2024-08-02fix(eval): handle wrong v:lua in expr option properly (#29953)zeertzjq1
2024-06-27refactor(typval)!: remove distinction of binary and nonbinary stringsbfredl1
This is a breaking change which will make refactor of typval and shada code a lot easier. In particular, code that would use or check for v:msgpack_types.binary in the wild would be broken. This appears to be rarely used in existing plugins. Also some cases where v:msgpack_type.string would be used to represent a binary string of "string" type, we use a BLOB instead, which is vimscripts native type for binary blobs, and already was used for BIN formats when necessary. msgpackdump(msgpackparse(data)) no longer preserves the distinction of BIN and STR strings. This is very common behavior for language-specific msgpack bindings. Nvim uses msgpack as a tool to serialize its data. Nvim is not a tool to bit-perfectly manipulate arbitrary msgpack data out in the wild. The changed tests should indicate how behavior changes in various edge cases.
2024-04-23test: improve test conventionsdundargoc1
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-02-18fix(eval): skip over v:lua properly (#27517)zeertzjq1
Problem: Error when parsing v:lua in a ternary expression. Solution: Set rettv->v_type for v:lua even if not evaluating.
2024-01-17test: big cleanup followupLewis Russell1
Followup to 07a7c0ec
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: typing for helpers.methsLewis Russell1
2024-01-12test: do not inject vim module into global helpersLewis Russell1
2023-12-18fix(lua): handle array with holes in luaeval() (#26630)zeertzjq1
2023-12-09test: avoid repeated screen lines in expected stateszeertzjq1
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
2023-05-22test: don't unnecessarily specify win/buf for `nvim_(get|set)_option_value`Famiu Haque1
`nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
2023-05-21refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell1
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-04-16vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131)zeertzjq1
Problem: Vim9: exception in ISN_INSTR caught at wrong level. Solution: Set the starting trylevel in exec_instructions(). (closes vim/vim#8214) https://github.com/vim/vim/commit/ff65288aa89dcd50760ad942d58baff70c6e93e6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16vim-patch:8.2.3783: confusing error for using a variable as a functionzeertzjq1
Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue vim/vim#9310) https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-08-20fix(eval): check for v:lua when calling callback (#19855)zeertzjq1
This makes callback_call() match call_vim_function() when calling a function.
2022-01-28fix(eval): v:lua support for `-` in module namesbb010g1
2021-11-06feat(lua): enable stack traces in error output (#16228)Gregory Anders1
2021-10-23feat(lua): document support of packages with v:lua syntaxBjörn Linse1
this already worked in 0.5 but was not properly documented or tested
2021-10-03feat(eval/method): partially port v8.1.1954Sean Dewar1
Does not include listener_*() functions. js_*() functions are N/A. json_encode() and json_decode() didn't include tests; add some anyway (to json_functions_spec.lua). test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
2021-09-15feat(decode_string): decode binary string with NULs to BlobSean Dewar1
Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
2021-09-15feat(nlua): convert Blobs to stringsSean Dewar1
2021-08-13feat(v:lua): support calling v:lua as a methodSean Dewar1
2021-08-12fix(v:lua): fix emsg when calling v:lua directlySean Dewar1
v:lua expressions are represented using vvlua_partial. As v:lua isn't intended to be called directly, it's given an empty pt_name. Because of this, calling v:lua directly like "v:lua()" will cause "E117: Unknown function: ", with an empty name. Instead, have call_func() show the name "v:lua" in the emsg.
2020-10-05test/vim.validate(): assert normalized stacktraceJustin M. Keyes1
- 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()
2020-07-19lua: Fix crash on unprotected lua errors (#12658)TJ DeVries1
Can be reproduced with a script like this: -- in some lua file vim.fn.timer_start(10, function() error("uh....") end) -- will cause neovim to crash with the following error. PANIC: unprotected error in call to Lua API (nlua_CFunction_func_call failed.) After this, it will instead print the error message from the top of the stack, like so. tmp/error_nvim.lua:10: uh... Also added an example test. Previously this test caused the embedded nvim to panic.
2020-07-10lua: Add ability to pass tables with __callTJ DeVries1
vim-patch:8.2.1054: not so easy to pass a lua function to Vim vim-patch:8.2.1084: Lua: registering function has useless code I think I have also opened up the possibility for people to use these callbacks elsewhere, since I've added a new struct that we should be able to use. Also, this should allow us to determine what the state of a list is in Lua or a dictionary in Lua, since we now can track the luaref as we go.
2020-07-10lua: Add ability to pass lua functions directly to vimLTJ DeVries1
2019-11-16Add v:lua.func() vimL syntax for calling luaBjörn Linse1
Also simplify error messages when calling lua from vimL.
2018-05-09API: return non-generic VimL errorsJustin M. Keyes1
- Return VimL errors instead of generic errors for: - nvim_call_function - nvim_call_dict_function - Fix tests which were silently broken before this change. This violates #6150 where we agreed not to translate API errors. But that can be fixed later.
2017-03-27executor,functests: Add print() tests, some fixesZyX1
2017-03-27executor: Fix some memory leaksZyX1
2017-03-27executor: Add :luado commandZyX1
2017-03-27doc,functests: Add documentationZyX1
Missing: updates to various lists.
2017-03-27functests: Some more testsZyX1
2017-03-27functests: Move existing tests from lua_spec to lua/*, fix themZyX1
2017-03-27functests: Add some testsZyX1