aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/system_spec.lua
Commit message (Collapse)AuthorAge
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* Merge #40865 from justinmk/fixciJustin M. Keyes2026-07-21
|\
| * test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* | fix(system): use native path for Windows executables #40885Sanzhar Kuandyk2026-07-21
|/ | | | | | | | | Problem: When 'shellslash' is set, exepath() returns forward-slashed paths. Passing that path to vim.system() can prevent cmd.exe from launching. Solution: Convert the resolved executable path to native separators before spawning. Add a Windows regression test for cmd.exe with 'shellslash' enabled.
* test(pack): unreliable "vim.pack" tests on Windows #40717Justin M. Keyes2026-07-13
| | | | | | | | | | | FAILED …/plugin/pack_spec.lua:92: …/plugin/pack_spec.lua @ 70: vim.pack update() can use lockfile revision as a target …/plugin/pack_spec.lua:92: …/plugin/pack_spec.lua:70: process still exists stack traceback: D:/a/neovim/neovim/test/functional/testnvim/exec_lua.lua:124: in function 'system_sync' …/plugin/pack_spec.lua:92: in function 'git_cmd' …/plugin/pack_spec.lua:113: in function 'git_add_commit' …/plugin/pack_spec.lua:1209: in function <…/plugin/pack_spec.lua:1173> fix #40167
* test: unreliable "vim.system (async) supports timeout"Justin M. Keyes2026-07-11
| | | | | | | | | | | | | | FAILED 2 tests, listed below: FAILED …/lua/system_spec.lua:124: …/lua/system_spec.lua @ 44: vim.system (async) supports timeout …/lua/system_spec.lua:124: …/lua/system_spec.lua:44: process still exists stack traceback: D:/a/neovim/neovim/test/functional/testnvim/exec_lua.lua:124: in function 'system' …/lua/system_spec.lua:124: in function <…/lua/system_spec.lua:118> FAILED …/lua/system_spec.lua:111: …/lua/system_spec.lua @ 22: vim.system (sync) can set environment with clear_env = true and env = nil …/lua/system_spec.lua:111: …/lua/system_spec.lua:22: process still exists stack traceback: D:/a/neovim/neovim/test/functional/testnvim/exec_lua.lua:124: in function 'system' …/lua/system_spec.lua:111: in function <…/lua/system_spec.lua:97>
* test: mark non-actionable tests as N/A #40207Justin M. Keyes2026-06-12
| | | | | | | | | | Problem: Listing individual "skipped" notices for each non-actionable or NVIM_TEST_INTEG test is noisy and makes the "skipped" list overwhelming and less meaningful. Solution: - Mark non-actionable tests with "N/A". - Report NVIM_TEST_INTEG tests as a separate 1-line summary.
* fix(vim.system): use REAL PIPES for vim.system, similar to jobsbfredl2026-04-30
| | | | | This is essentially the #35991 fix for the #35984 issue, but applied to vim.system().
* refactor(test): drop deprecated exc_exec #39242Justin M. Keyes2026-04-20
|
* docs: api, pack, events, developJustin M. Keyes2025-07-10
|
* fix(vim.system): env=nil passes env=nil to uv.spawnLewis Russell2025-07-02
| | | | | | | | | | | | 731e616a79 made it so passing `{env = nil, clear_env = true }` would pass `{env = {}}` to `vim.uv.spawn`. However this is not what `clear_env` is (arguably) supposed to do. If `env=nil` then that implies the uses wants `vim.uv.spawn()` to use the default environment. Adding `clear_env = true` simply prevents `NVIM` (the base environment) from being added. Fixes #34730
* fix(vim.system): clear_env=true gives an invalid env to uv.spawn #33955Birdee2025-06-25
| | | | | | | | | Problem: In setup_env, some needed logic is bypassed when clear_env=true. Solution: Drop the early return in setup_env(). Co-authored-by: BirdeeHub <birdee@localhost>
* fix(vim.system): improve error message when cwd does not existLewis Russell2025-05-29
| | | | | | | | | | Problem: vim.uv.spawn will emit ENOENT for either when the cmd or cwd do not exist and does not tell you which. Solution: If an error occurs, check if cwd was supplied and included in the error message if it does not exist.
* fix(vim.system): unclear non-executable message #33455Justin M. Keyes2025-04-16
| | | | | | | | | | | | | | | | | | Problem: When a command is not found or not executable, the error message gives no indication about what command was actually tried. Solution: Always append the command name to the error message. BEFORE: E5108: Error executing lua …/_system.lua:248: ENOENT: no such file or directory AFTER: E5108: Error executing lua …/_system.lua:249: ENOENT: no such file or directory: "foo" fix #33445
* test(system_spec): check for .git dir before using git (#31458)zeertzjq2024-12-05
|
* fix(vim.system): close pipe handles after process handleLewis Russell2024-12-04
| | | | Fixes #30846
* docs: misc (#31138)dundargoc2024-11-21
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(vim.system): resolve executable paths on windowsLewis Russell2024-11-08
| | | | Fixes #31107
* test: support upvalues in exec_luaLewis Russell2024-09-21
|
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | 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.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* fix(vim.system): don't process non-fast events during wait() (#27300)zeertzjq2024-02-02
| | | | | | | | Problem: Processing non-fast events during SystemObj:wait() may cause two pieces of code to interfere with each other, and is different from jobwait(). Solution: Don't process non-fast events during SystemObj:wait().
* refactor: format test/*Justin M. Keyes2024-01-03
|
* refactor(vim.system): factor out on_exit handlingLewis Russell2023-09-05
|
* fix(vim.system): make timeout work properlyLewis Russell2023-09-05
| | | | Mimic the behaviour of timeout(1) from coreutils.
* fix(vim.system): let on_exit handle cleanup after killLewis Russell2023-09-05
| | | | Fixes #25000
* feat(lua): add `vim.system()`Lewis Russell2023-06-07
feat(lua): add vim.system() Problem: Handling system commands in Lua is tedious and error-prone: - vim.fn.jobstart() is vimscript and comes with all limitations attached to typval. - vim.loop.spawn is too low level Solution: Add vim.system(). Partly inspired by Python's subprocess module Does not expose any libuv objects.