aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/menu_spec.lua
Commit message (Collapse)AuthorAge
* test: simplify functional test expectationsLewis Russell2026-10-05
| | | | | | | | | | | | Problem: Repeated default fields and field-by-field assertions obscure the values that each functional test is meant to check. Solution: Add eq_partial() to check selected record fields while preserving list length and order. Use local helpers to fill fixed expected defaults where tests need full equality. Keep explicit absence checks and test-specific values at the call sites. AI-assisted
* fix(menu): menu_get() files terminal mode menus under the tooltip key #41687Volodymyr Chernetskyi2026-09-04
| | | | | | | | | | | | | Problem: `menu_mode_chars` includes the two-character `"tl"` value. The hardcoded `1` is the `key_len` argument of `tv_dict_add_dict()`, which truncated it to `"t"`, the designator for a tooltip. Scripts keying on the documented mode designators therefore miss terminal mode entries and misread them as tooltips. Solution: Pass the real length of the designator. AI-assisted
* fix(menu): menu_get() cannot tell :noremenu from :menu <script> #41686Volodymyr Chernetskyi2026-09-04
| | | | | | | | | | | | | | | | | | | | Problem: `REMAP_NONE` is -1 and `REMAP_SCRIPT` is -2. These are enumerated values, not bit flags, so `&` is the wrong operator: `x & -1` is `x`, and `-1 & -2` is -2, which is truthy. Both kinds of non-remapping menu therefore reported `noremap` and `sid` as 1 and became indistinguishable. The sibling `menu_get_info()` already compares with `==`. Solution: Compare rather than mask. The expectations in menu_spec.lua had the conflated values baked in, so 22 entries from plain `*noremenu` commands now report `sid = 0`, and the two from `nnoremenu <script> Export.Script` now report `noremap = 0`. AI-assisted
* test: fix wrong order of args to eq(), neq() #41499zeertzjq2026-08-26
|
* 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`.
* docs: miscJustin M. Keyes2026-03-20
|
* fix(menu): right-click menu fails with E335 when using V after i_ctrl-o #37349glepnir2026-03-18
| | | | | | | | | | | Problem: Right-click menu fails with E335 when using V in Insert mode (after i_ctrl-o). The mode detection checks restart_edit before VIsual_active, incorrectly selecting Insert mode binding even when Visual mode is active. Solution: Check Visual mode before Insert mode, to match get_menu_mode() priority order.
* fix(menu): fix listing of submenus (#34315)zeertzjq2025-06-05
| | | | | | | | Problem: Listing submenus with :menu doesn't work. Solution: Don't go to the parent of the return value of find_menu(), and handle empty path at the caller. Related #8194, which actually only fixed the problem for menu_get(), not for :menu Ex command.
* 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.
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: normalise nvim bridge functionsLewis Russell2024-01-12
| | | | | - remove helpers.cur*meths - remove helpers.nvim
* refactor: format test/*Justin M. Keyes2024-01-03
|
* feat(defaults): mouse=nvi #19290matveyt2022-07-17
| | | | | | | | | | Problem: Since right-click can now show a popup menu, we can provide messaging to guide users who expect 'mouse' to be disabled by default. So 'mouse' can now be enabled by default. Solution: Do it. Closes #15521
* tests: use vim.inspect (#10485)Daniel Hahler2019-07-13
| | | | | | | The inspect modules is vendored as `vim.inspect`, and therefore it makes sense to use this in tests also. Ref: https://github.com/neovim/neovim/issues/6580 Ref: https://github.com/neovim/neovim/commit/bb3aa824b
* menu_get(): fix query behaviorJustin M. Keyes2019-01-27
| | | | | | - Return the menu properties, not only its children. - If the {path} param is given, return only the first node. The "next" nodes in the linked-list are irrelevant.
* menu_get(): Do not include empty itemsJustin M. Keyes2019-01-27
| | | | | Caused by a typo: `dict` instead of `dic`. Renamed variable to `d` to make it less similar.
* fix ":menu Item.SubItem"Justin M. Keyes2019-01-27
| | | | | | | | | | | | | | :menu should print sub-menu contents. E.g. this should print the "File.Save" submenu: nvim -u NORC :source $VIMRUNTIME/menu.vim :menu File.Save Regressed in dc685387a3d6 Blocks #8173 menu_get() also was missing some results for some cases.
* test: avoid redundant clear() #7340Justin M. Keyes2017-10-16
|
* More testsKillTheMule2017-10-02
|
* menu_get: adjust tests for prettyprintingKillTheMule2017-10-01
| | | | ... and add a bit of new testing
* menu_get(): docJustin M. Keyes2017-07-28
|
* viml: introduce menu_get() function #6322Matthieu Coudron2017-07-28
| | | | menu_get({path}, {modes}). See :h menu_get.
* functests: Fix linter errorsZyX2017-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.
* test: functional: Remove unnecessary use of clipboard registerJames McCoy2016-06-15
| | | | | | | | | menu_spec.lua yanks to the clipboard, but never pastes from it. This can leave a child xsel process waiting around for something to paste the content, causing the test process to hang. Since the test isn't explicitly trying to exercise the clipboard, simply use the default register.
* functests: Check logs in lua codeZyX2016-06-10
| | | | | | It is otherwise impossible to determine which test failed sanitizer/valgrind check. test/functional/helpers.lua module return was changed so that tests which do not provide after_each function to get new check will automatically fail.
* test: menu_spec: avoid screen test.Justin M. Keyes2015-10-04
| | | | | Redraw can be flaky especially when remote commands happen during command-mode. Assert the state directly instead of using Screen.
* menu: support :emenu invoked by cmenu map.bambu2015-10-03
|
* menu: Fix :emenu mode detection #2992Robin Allen2015-07-22
A menu item can have separate bindings for each Vim mode. :emenu checks to see which binding it should execute. But, it assumes it can only be called from Normal mode, so its mode detection is based on some guesswork. For instance, it detects if you've just used C-O and, if so, uses the Insert mode binding. Now that :emenu can be called from any mode (via vim_command), this commit has it check the actual mode we're in, and simply use the binding for that mode if we aren't in Normal mode.