Commit Graph

37 Commits

Author SHA1 Message Date
zeertzjq
d6fac187f1
test(tui_spec): prevent race between nvim_input and nvim_paste (#27356) 2024-02-06 14:05:49 +08: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
Justin M. Keyes
04f2f864e2 refactor: format test/* 2024-01-03 02:09:29 +01:00
Gregory Anders
8957df4f22 test: forward $VIMRUNTIME in child nvim instances 2023-12-07 11:54:22 -08:00
zeertzjq
6b00b8a369
test(terminal): remove unnecessary string operations (#26434) 2023-12-07 07:15:37 +08:00
Gregory Anders
a5a346678a test: set notermguicolors in tests
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.
2023-12-06 10:38:44 -08:00
zeertzjq
ce56ad2ba7
test: reduce flakiness (#24443)
Avoid consecutive RPC requests involving :startinsert or :stopinsert,
because consecutive RPC requests may be processed together, before the
:startinsert or :stopinsert takes effect.

Also change some feed_command() to command() to make tests faster.
2023-07-23 12:46:56 +08:00
zeertzjq
c19bd47c0a
test(tui_spec): improve cursor_address test (#21700) 2023-01-09 12:20:50 +08:00
Jakub Łuczyński
4650af38f0
test: fix failing tui_spec.lua tests (#21117)
* refactor(test): use exec_lua

* fix(test): fix failing tui_spec tests

test is failing when path of tty-test does not fit cmdline
2022-11-19 20:46:04 +08:00
Andrey Bushev
4bb1d1df79 feat(terminal): recognize underdouble and undercurl 2022-09-26 11:53:20 +08:00
Justin M. Keyes
f977f9445f refactor(tests): introduce testprg()
Also:
- Add a describe('shell :!') section to system_spec.
- Make the test for #16271 work on systems without powershell.
2022-06-25 08:27:17 -07:00
zeertzjq
a2f157233f
fix(tui)!: remove ESC NUL forced escape (#17198)
This make Nvim recognize `ESC NUL` as <M-C-Space>, as many terminal
emulators (including libvterm) send <M-C-Space> as `ESC NUL`.

There is already another unambiguous way to encode a `ESC` key supported
by libtermkey: `ESC [ 2 7 u`, which is a `CSI u` sequence.

If one still wants to use `ESC NUL` as `ESC`, they can just map
<M-C-Space> to <Esc>.
2022-04-11 10:23:33 +08:00
zeertzjq
ede4eac61f test: mention poke_eventloop() instead of wait() 2022-03-02 22:31:20 +08:00
Björn Linse
5a85699425 tests/ui: make screen.lua use "linegrid" representation internally
PR #8221 took a short-cut when implementing the tests: screen.lua would
translate the linegrid highlight ids back into the old per-cell
attribute description.

Apart from cleaning up technical debt, this enables to check both rgb
and cterm colors in the same expect(), which previously was needlessly
restricted to ext_hlstate tests only.
2019-10-13 22:10:42 +02:00
Jaskaran Singh
3afb397407 syntax, TUI: support "strikethrough"
fix #3436

Includes:
vim-patch:8.0.1038: strike-through text not supported
2019-09-13 14:46:19 -07:00
Björn Linse
e04b9e7c78 test/ui: update tests for new msg_grid implementation 2019-09-01 15:55:10 +02:00
Justin M. Keyes
21f0f7bca5 paste: WIP #4448 2019-08-27 21:19:10 +02:00
Björn Linse
2ab70cb55c window/ui: reorganize size variables, fix terminal window size with multigrid.
wp->w_height_inner now contains the "inner" size, regardless if the
window has been drawn yet or not. It should be used instead of
wp->w_grid.Rows, for stuff that is not directly related to accessing
the allocated grid memory, such like cursor movement and terminal size
2019-01-27 12:07:06 +01:00
Utkarsh Maheshwari
ebe16cd9bd multigrid: add multigrid screen tests 2018-12-31 12:44:22 +01:00
Justin M. Keyes
deb18a050e
defaults: background=dark #2894 (#9205)
By historical accident, Nvim defaults to background=light. So on a dark
background, `:colorscheme default` looks completely wrong.

The "smart" logic that Vim uses is confusing for anyone who uses Vim on
multiple platforms, so rather than mimic that, pick the (hopefully) most
common default.

- Since Neovim is dark-powered, we assume most users have dark backgrounds.
- Most of the GUIs tend to have a dark background by default.

ref #6289
2018-11-20 10:52:49 +01:00
erw7
d3a8c4f992 win/pty: log errors 2017-08-16 09:13:44 +02:00
erw7
1614e805b3 win/test: tty-test: print screen size explicitly with CTRL-Q
tty-test.exe causes abnormal termination with low repeatability, try
changing it so as not to use SIGWINCH.
2017-08-16 09:13:44 +02:00
erw7
4b1f21de75 win: support :terminal 2017-08-16 09:13:43 +02: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
152921837e test: screen_setup(): Detect spawn failures, usage errors. 2017-02-26 13:00:01 +01:00
Justin M. Keyes
d90e5f5260 test: screen_setup(): Support cols parameter. 2017-02-26 13:00:01 +01:00
Justin M. Keyes
e7bbd35c81 terminal: 'scrollback'
Closes #2637
2017-02-26 11:57:52 +01:00
Justin M. Keyes
97204e1cef os/shell: Throttle :! output, pulse "..." message.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
    :!yes
    :!while true; do date; done
    :!git grep ''
    :grep -r '' *

After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
    * 10KB received
    * ~1s throttled

This also avoids out-of-memory which could happen with large :! outputs.

Note: This commit does not change the behavior of execute(':!foo').
      execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
      messages, *not* shell command output. Vim behaves the same way.
      Use system('foo') for capturing shell command output.

Closes #1234

Helped-by: oni-link <knil.ino@gmail.com>
2016-12-09 18:51:17 +01:00
Björn Linse
c41bacc67c api/ui: add tests for popupmenu_external events
update screen.lua to use new style nvim_ui_attach
2016-08-29 10:17:31 +02:00
Björn Linse
f332eba16c tests: don't ignore highlights in terminal tests 2016-08-14 21:53:02 +02: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
Marco Hinz
4a69e55f39 test/functional: clean up according to luacheck (part 1) 2015-11-23 13:57:21 +01:00
Thiago de Arruda
5d185c7772 test: Add basic tests for the TUI
The tests use `termopen` to spawn nvim and verify the TUI.
2015-10-01 15:22:49 -03:00
Scott Prager
74aef89720 term: use an argument vector for termopen().
Old behaviour: termopen('cmd') would run `&shell &shcf "cmd"`, which
caused the functional tests to fail on some systems due to the process
not "owning" the terminal. Also, it is inconsistent with jobstart().

Modify termopen() so that &shell is not invoked, but maintain the old
behaviour with :terminal. Factor the common code for building the
argument vector from jobstart() and modify the functional tests to call
termopen() instead of :terminal (fixes #2354).

Also:
 * Add a 'name' option for termopen() so that `:terminal {cmd}` produces
   a buffer named "term//{cwd}/{cmd}" and termopen() users can customize
   the name.
 * Update the documentation.
 * Add functional tests for `:terminal` sinse its behaviour now differs
   from termopen(). Add "test/functional/fixtures/shell-test.c" and move
   "test/functional/job/tty-test.c" there, too.

Helped-by: Justin M. Keyes <@justinmk>
2015-05-02 09:47:29 -04:00
Marco Hinz
cd7b910e81 Add new highlight groups TermCursor/TermCursorNC
These highlight groups replace the old mechanism of setting:

  - {g,b}:terminal_focused_cursor_highlight
  - {g,b}:terminal_unfocused_cursor_highlight
2015-04-09 16:38:32 +02:00
Thiago de Arruda
2aa2513b8e test: Add terminal tests
- Modify tty-test to allow easier control over the terminal
- Add a new directory with various terminal tests/specifications
- Remove a pending job/pty test.
- Flush stdout in Screen:snapshot_util() (avoid waiting for the test to finish)
- Replace libuv sigwinch watcher by a sigaction handler. libuv randomly fails to
  deliver signals on OSX. Might be related to the problem fixed by
  @bbcddc55ee1e5605657592644be0102ed3a5f104 (under the hoods, libuv uses a pipe
  to deliver signals to the main thread, which might be blocking in some
  situations)
2015-03-25 18:57:36 -03:00