aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
Commit message (Collapse)AuthorAge
...
* test: do not inject vim module into global helpersLewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* build: enable lintlua for test/ dirJustin M. Keyes2024-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Not all Lua code is checked by stylua. Automating code-style is an important mechanism for reducing time spent on accidental (non-essential) complexity. Solution: - Enable stylua for entire `test/` directory. - Exclude these high-churn files until this issue is resolved: https://github.com/JohnnyMorganz/StyLua/issues/829 ``` test/functional/ui/decorations_spec.lua | 3560 ++++++++++++++++++++++++++++++++++++---------------- test/functional/ui/float_spec.lua | 5826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------- test/functional/ui/multigrid_spec.lua | 1349 ++++++++++++++------ ``` - Make surgical changes to these files (or add `stylua: ignore` in some small scopes) to improve the result: ``` test/functional/vimscript/msgpack_functions_spec.lua | 1414 +++++++++++++++------ test/functional/api/buffer_spec.lua | 1389 +++++++++++---------- test/functional/api/vim_spec.lua | 2740 +++++++++++++++++++++++----------------- ``` - These "high churn" files are NOT excluded because the changes are largely an improvement: ``` test/functional/plugin/lsp_spec.lua | 2198 ++++++++++++++++++--------------- test/functional/plugin/shada_spec.lua | 4078 +++++++++++++++++++++++++++++++++++------------------------- test/functional/ui/cmdline_spec.lua | 1199 +++++++++++------- test/functional/ui/popupmenu_spec.lua | 1267 +++++++++++-------- test/functional/ui/messages_spec.lua | 1643 +++++++++++++++--------- ``` - TODO: how to check "all directories"? With `GLOB_DIRS *` and `/.deps/` (or `.deps/`) in `.styluaignore`, Lua code in `.deps/` is still checked...
* fix(inccommand): don't preview in Ex mode (#26587)Raphael2023-12-27
|
* test(core/job_spec): fix flakiness (#26623)zeertzjq2023-12-18
|
* feat(highlight): tweak default color schemeEvgeni Chasnovski2023-12-16
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Updating default color scheme produced some feedback. Solution: Address the feedback. Outline of the changes: - Colors `Grey1` and `Grey2` are made a little bit more extreme (dark - darker, light - lighter) to increase overall contrast. - `gui` colors are treated as base with `cterm` colors falling back to using 0-15 colors which come from terminal emulator. - Update highlight group definition to not include attribute definition if it is intended to staty uncolored. - Tweak some specific highlight groups. - Add a list of Neovim specific highlight groups which are now defined differently in a breaking way. - Minor tweaks in several other places related to default color scheme.
* fix(stream): do not close handle if it is already closing (#26537)Gregory Anders2023-12-12
| | | | | uv_close asserts that a handle is not already closing. We can guard against this assertion failure by manually checking the handle's closing status ourselves.
* test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
| | | | | | 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
* test: use termopen() instead of :terminal more (#26462)zeertzjq2023-12-08
|
* test: fix Windows tests failures (#26461)Gregory Anders2023-12-08
|
* test: forward $VIMRUNTIME in child nvim instancesGregory Anders2023-12-07
|
* Merge pull request #26407 from gpanders/default-tgcGregory Anders2023-12-06
|\ | | | | feat(defaults): enable 'termguicolors' by default when supported by terminal
| * test: set notermguicolors in testsGregory Anders2023-12-06
| | | | | | | | | | | | Set 'notermguicolors' in tests which spawn a child Nvim process to force existing tests to use 16 colors. Also refactor the child process invocation to make things a little bit less messy.
* | test: unreliable 'nofsync' test #26423Justin M. Keyes2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to 27501d3b6a8d577cf3f5ecc3fe9e219f477586b7. Problem: CI sometimes fails. Something is triggering an extra fsync(). FAILED test/functional/core/fileio_spec.lua @ 52: fileio fsync() with 'nofsync' #8304 test/functional/core/fileio_spec.lua:100: Expected objects to be the same. Passed in: (number) 5 Expected: (number) 4 Solution: Relax the assertion.
* | test: 'nofsync' with deadly signal #26415Justin M. Keyes2023-12-06
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The test for 'nofsync' swapfile preservation on a deadly signal, does not actually assert anything. followup to 1fd29a28841dee3d25ff079eb24fc160eb02cb3c Solution: Check that swapfile contents are present after getting SIGTERM. TODO: this doesn't really verify that 'fsync' was called; it still passes with this patch: diff --git a/src/nvim/main.c b/src/nvim/main.c index 216e39f3e81c..7a635520401d 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -838,7 +838,7 @@ void preserve_exit(const char *errmsg) if (errmsg != NULL) { os_errmsg("Vim: preserving files...\r\n"); } - ml_sync_all(false, false, true); // preserve all swap files + ml_sync_all(false, false, false); // preserve all swap files break; } } However it correctly fails with this patch, at least: diff --git a/src/nvim/main.c b/src/nvim/main.c index 216e39f3e81c..f2306c310ddc 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -838,7 +838,6 @@ void preserve_exit(const char *errmsg) if (errmsg != NULL) { os_errmsg("Vim: preserving files...\r\n"); } - ml_sync_all(false, false, true); // preserve all swap files break; } }
* test: fileio_spec is unreliable/flaky #26404Justin M. Keyes2023-12-05
| | | | | | | | | | | | | | | | | | | | Problem: CI sometimes fails. Something is triggering an extra fsync(). FAILED test/functional/core/fileio_spec.lua @ 52: fileio fsync() codepaths #8304 test/functional/core/fileio_spec.lua:87: Expected objects to be the same. Passed in: (number) 3 Expected: (number) 2 stack traceback: test/functional/core/fileio_spec.lua:87: in function <test/functional/core/fileio_spec.lua:52> Solution: Relax the assertion to `fsync >= 2` instead of exactly 2. (Note this is not a behavior change: the next assertion has always checked `fsync == 4`, it's just that the intermediate 3rd fsync was never explicitly asserted.)
* feat(highlight): update default color schemeEvgeni Chasnovski2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Default color scheme is suboptimal. Solution: Start using new color scheme. Introduce new `vim` color scheme for opt-in backward compatibility. ------ Main design ideas - Be "Neovim branded". - Be minimal for 256 colors with a bit more shades for true colors. - Be accessible through high enough contrast ratios. - Be suitable for dark and light backgrounds via exchange of dark and light palettes. ------ Palettes - Have dark and light variants. Implemented through exporeted `NvimDark*` and `NvimLight*` hex colors. - Palettes have 4 shades of grey for UI elements and 6 colors (red, yellow, green, cyan, blue, magenta). - Actual values are computed procedurally in Oklch color space based on a handful of hyperparameters. - Each color has a 256 colors variant with perceptually closest color. ------ Highlight groups Use: - Grey shades for general UI according to their design. - Bold text for keywords (`Statement` highlight group). This is an important choice to increase accessibility for people with color deficiencies, as it doesn't rely on actual color. - Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some minor text UI elements. - Cyan as main syntax color, i.e. for function usage (`Function` highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI elements. - Red to generally mean high user attention, i.e. errors; in particular for `ErrorMsg`, `DiffDelete`, `DiagnosticError`. - Yellow very sparingly only with true colors to mean mild user attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`. - Blue very sparingly only with true colors as `DiagnosticHint` and some additional important syntax group (like `Identifier`). - Magenta very carefully (if at all). ------ Notes - To make tests work without relatively larege updates, each one is prepended with an equivalent of the call `:colorscheme vim`. Plus some tests which spawn new Neovim instances also now use 'vim' color scheme. In some cases tests are updated to fit new default color scheme.
* fix(defaults): set 'fsync' #26034Ploum2023-11-14
| | | | | | | | Problem: 'nofsync' may lose data if the system has a hard shutdown. #9888 Solution: Change default to 'fsync'. This may be revisited in the future when 'nofsync' can be made safer.
* fix(f_wait): flush UI before blocking (#25962)zeertzjq2023-11-10
|
* fix(job-control): make jobwait() flush UI after hiding cursor (#25927)zeertzjq2023-11-08
|
* refactor(test): cleanup #25614Justin M. Keyes2023-10-12
| | | | | - unnecessary separate describe() group - clear() wasn't called in the describe() group - unnecessary indirection in function parameters
* test(core/path_spec): don't use fnameescape() (#25593)zeertzjq2023-10-11
| | | | | Using fnameescape() for the path argument of findfile() and finddir() is wrong, as fnameescape() is intended to be used for parts of Ex commands, not function arguments.
* fix(file_search): path with spaces in finddir() and findfile() (#25493)Leonardo Mello2023-10-10
| | | Co-authored-by: dundargoc <gocdundar@gmail.com>
* refactor: cleanupJustin M. Keyes2023-10-06
|
* fix: gf fails on "foo/bar.txt:1:2" on WindowsLeonardo Mello2023-10-06
| | | | | | | | | | | | | | | Problem: On Windows, "gf" fails on a filepath that has a line:column suffix. Example: E447: Can't find file "src/app/core/services/identity/identity.service.ts:64:23" Solution: - Remove ":" from 'isfname' on Windows. Colon is not a valid filename character (except for the drive-letter). - Handle drive letters specially in file_name_in_line(). Fixes #25160
* fix(path): accept special characters on Windows (#25424)Leonardo Mello2023-10-04
|
* refactor(message): simplify msg_puts_display and use batched grid updatesbfredl2023-10-03
| | | | | | | | | msg_puts_display was more complex than necessary in nvim, as in nvim, it no longer talks directly with a terminal. In particular we don't need to scroll the grid before emiting the last char. The TUI already takes care of things like that, for terminals where it matters.
* test(fileio_spec): fix files not cleaned up properly (#25483)zeertzjq2023-10-03
|
* feat: NVIM_APPNAME supports relative paths #25233Rory Nesbitt2023-09-27
| | | | | | | | | | | | | | Problem: NVIM_APPNAME does not allow path separators in the name, so relative paths can't be used: NVIM_APPNAME="neovim-configs/first-config" nvim NVIM_APPNAME="neovim-configs/second-config" nvim Solution: Let NVIM_APPNAME be a relative path. Absolute paths are not supported. fix #23056 fix #24966
* feat(remote): avoid --remote-ui infinite loop (#24465)shafouz2023-08-13
|
* test(core/startup_spec): use retry() instead of jobwait() (#24481)zeertzjq2023-07-25
| | | This should work on Windows.
* fix(startup): make recovery mode work without --headless (#24477)zeertzjq2023-07-25
|
* test(startup_spec): add a test for #18315 (#24391)zeertzjq2023-07-19
|
* feat(options)!: remove compatible behaviours for vim 5.0 and earlierLewis Russell2023-07-17
|
* test(fs): vim.loop was renamed to vim.uv (#24376)kylo2522023-07-17
| | | test(fs): vim.loop has been replaced with vim.uv
* test(fs): get tmpdir robustly #23021kylo2522023-07-16
| | | | | | | | Problem: helpers.tmpname() may create a local file, depending on circumstances. Solution: Only use helpers.tmpname() for its parent directory (the "temp root"). Use fs_mkdtemp() to actually get a unique name.
* fix(runtime): respect 'rtp' order for all runtime files (#24335)zeertzjq2023-07-14
|
* fix(startup)!: "nvim -l" message does not end with newline #24215zeertzjq2023-07-01
| | | Close #24180
* feat(version): unverbose ":version", ":verbose version" #24195Justin M. Keyes2023-07-01
| | | | | | | | | Problem: `nvim -v` and `:version` prints system vimrc, fallback files, and compilation info by default, which most people don't care about and just clutters up the output. Solution: Omit extra info unless 'verbose' is set.
* fix(startup): don't truncate when printing with -l (#24216)zeertzjq2023-07-01
|
* fix(startup): "nvim -l foo.lua" may not set arg0 #24161Mike2023-06-26
| | | | | | | | | | | | | | | | | Problem: Using "nvim -l args.lua" without passing extra script args, does not set `_G.arg[0]`. Steps to reproduce: ``` cat > args.lua<<EOF vim.print(_G.arg, '') vim.print(vim.v.argv, '') EOF nvim --clean -l args.lua ``` Solution: Fix condition in command_line_scan.
* fix(remote): restore previous --remote-expr output formatting (#23988)zeertzjq2023-06-11
| | | | - Use tostring() as that's what print() uses internally. - Do not append trailing new line.
* fix(remote): make --remote-expr print to stdout (#23980)zeertzjq2023-06-11
|
* test(core/startup_spec): add a test for #13720 (#23910)zeertzjq2023-06-05
|
* feat(lua): rename vim.loop -> vim.uv (#22846)Lewis Russell2023-06-03
|
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* test(startup_spec): use getscriptinfo() instead of :scriptnames (#23034)zeertzjq2023-04-12
|
* refactor: remove :CheckHealthdundargoc2023-04-12
| | | | | Using :CheckHealth invokes an error, and many of the features from :checkhealth doesn't even work such as calling only a specific check. Users should use :checkhealth instead.
* test: replace lfs with luv and vim.fsdundargoc2023-04-04
| | | | | | test: replace lfs with luv luv already pretty much does everything lfs does, so this duplication of dependencies isn't needed.
* test: use exec_capture() in more places (#22787)zeertzjq2023-03-26
| | | | | | | Problem: Using `meths.exec2("code", { output = true })` is too verbose. Solution: Use exec_capture() in more places.