Commit Graph

28 Commits

Author SHA1 Message Date
bfredl
e61228a214 fix(tests): needing two calls to setup a screen is cringe
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-11-14 12:40:57 +01:00
dundargoc
052498ed42 test: improve test conventions
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-23 18:17:04 +02:00
Lewis Russell
81fc27124b refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
bfredl
0c59771e31 refactor(tests): all screen tests should use highlights
This is the first installment of a multi-PR series significantly
refactoring how highlights are being specified.

The end goal is to have a base set of 20 ish most common highlights,
and then specific files only need to add more groups to that as needed.

As a complicating factor, we also want to migrate to the new default
color scheme eventually. But by sharing a base set, that future PR
will hopefully be a lot smaller since a lot of tests will be migrated
just simply by updating the base set in place.

As a first step, fix the anti-pattern than Screen defaults to ignoring
highlights. Highlights are integral part of the screen state, not
something "extra" which we only test "sometimes". For now, we still
allow opt-out via the intentionally ugly

  screen._default_attr_ids = nil

The end goal is to get rid of all of these eventually (which will be
easier as part of the color scheme migration)
2024-03-23 13:44:35 +01:00
Lewis Russell
795f896a57 test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
Lewis Russell
4f81f506f9 test: normalise nvim bridge functions
- remove helpers.cur*meths
- remove helpers.nvim
2024-01-12 17:53:27 +00:00
Lewis Russell
c30f2e3182 test: typing for helpers.meths 2024-01-12 13:01:06 +00:00
Justin M. Keyes
04f2f864e2 refactor: format test/* 2024-01-03 02:09:29 +01:00
zeertzjq
7d58de11f4
fix(rpc)!: preseve files when stdio channel is closed (#22137)
BREAKING CHANGE: Unsaved changes are now preserved rather than discarded
when stdio channel is closed.
2023-02-11 18:25:01 +08:00
bfredl
068a998e60 fix(tests): remove irrelevant usage of display-=msgsep
These were just added to avoid churn when changing the default
of 'display'. To simplify message handling logic, we might want
to remove support for printing messages in default_grid later on.
This would allow things like printing error messages safely in the
middle of redraw, or a future graduation of the 'multigrid' feature.
2022-08-17 23:44:49 +02:00
Björn Linse
07cc231142 A Mudholland Dr. Recast
The commit summary maybe does not make sense, but calling a function
that does not wait on anything `wait()` makes even less sense.
2020-10-19 21:48:06 +02:00
Justin M. Keyes
17291642bd test: clear(): args_rm parameter 2019-04-27 16:19:40 +02:00
Björn Linse
4da5cb38d3 startup: always wait for UI with --embed, unless --headless also is supplied 2018-09-22 10:18:28 +02:00
Björn Linse
98e7112390 msg: do not scroll entire screen (#8088) 2018-03-31 11:12:27 +02:00
James McCoy
35d817e68c
oldfiles_spec: Add tests for ":filter ... oldfiles" 2017-04-29 23:58:03 -04:00
James McCoy
4488bfcfb3
oldfiles_spec: Set the shada file in the session 2017-04-29 23:48:28 -04:00
ZyX
65fb622000 functests: Replace execute with either command or feed_command
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.
2017-04-09 03:24:08 +03:00
Justin M. Keyes
a90beeadbb defaults: 'showcmd', 'belloff', 'ruler'
- Vim "unix default" of 'noshowcmd' is serving few users. And it's
  inconsistent.
- 'ruler' and 'belloff=all' improve the out-of-the-box experience.
- Continue to use 'noshowcmd' and 'noruler' by default in the functional
  tests to keep them fast.

TODO: Add a "disable slow stuff" command or mapping to address the
use-case of a very slow terminal connection.
2017-03-16 18:44:10 +01:00
Justin M. Keyes
44e6ee930f build: Target luacheck HEAD.
https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606

> If you really want to use bleeding-edge version you should get the
> rockspec from master branch, not a fixed commit ...
> The correct way to install from a specific commit is cloning that
> commit and running "luarocks make" from project directory. The reason
> is that running "install" or "build" on an scm rockspec fetches
> sources from master but uses build description from the rockspec
> itself, which may be outdated.
2016-11-17 00:55:39 +01:00
James McCoy
d0c0930acf Restore ":browse oldfiles" behavior from Vim
In 3b12bb225a, ":oldfiles" was taught to
behave like Vim's ":browse oldfiles" if ":oldfiles!" was used.  However,
this conflates the use of ! for abandoning a modified buffer with
choosing one file out of a list of oldfiles.

Now that ":browse" is supported again, ":browse oldfiles" will allow the
user to select an old file, while still complaining if that would cause
a modified buffer to be abandoned.  ":browse oldfiles!" will just
abandon the buffer, as expected.
2016-08-11 13:37:42 -04:00
ZyX
ff470bb853 functests: Check logs in lua code
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.
2016-06-10 21:50:49 +03:00
Björn Linse
01eafc0c17 tests: fix indeterministic oldfiles! test 2016-04-14 18:11:39 +02:00
Thiago de Arruda
f5f11b9e2f Remove indeterminism in oldfiles_spec.lua
If Nvim is in a "Press ENTER..." screen before the `get_vvar()` call, the test
will hang.
2016-04-11 23:07:52 -03:00
Marco Hinz
d9fbc1865b test/functional: clean up according to luacheck (part 2) 2015-11-23 13:57:21 +01:00
John Szakmeister
d4f3d819d8 Workaround the unstable ordering of v:oldfiles in some more tests.
Fixes #3676.

Reviewed-by: Marco Hinz <mh.codebro@gmail.com>
2015-11-16 08:29:45 -05:00
Marco Hinz
947e356cda Test: improve functional/ex_cmds/oldfiles_spec.lua
- change approach for test 1: screen:expect() instead of assert()
- use execute() instead of command()
- 2 new tests that check none and wrong input for :oldfiles!

Helped-by: @fwalch
Helped-by: @tarruda
Helper-by: @justinmk
2015-11-11 17:12:02 +01:00
Marco Hinz
dc65c8a893 Add tests for :oldfiles 2015-11-10 03:13:31 +01:00