Commit Graph

139 Commits

Author SHA1 Message Date
Justin M. Keyes
b11b681289 test/util: matches() 2018-04-11 01:58:41 +02:00
Justin M. Keyes
496b0f944f test: next_msg(): default timeout to 10s
Infinite timeout results in hangs which waste time. If some test needs
longer than 10s to wait for a message, it should specify the timeout
explicitly.
2018-03-11 12:43:42 +01:00
Justin M. Keyes
fd4021387e test: rename next_message() to next_msg() 2018-03-11 12:43:42 +01:00
Jan Edmund Lazo
d80bf3c656 test: enable ex_cmds/cd_spec.lua on Windows 2018-02-19 07:10:46 -05:00
Justin M. Keyes
7973847d02 test/util: remove eq_any()
It was added in the parent commit, but ended up not being used. And
I can't think of a case where it will be used: instead we would probably
want to generalize expect_msg_seq() if necessary.
2018-02-18 19:22:44 +01:00
Justin M. Keyes
e72ecdb7ca test/util: expect_msg_seq()
job_spec.lua on AppVeyor (Windows) often fails like this:

      FAILED  ] C:/projects/neovim/test/functional\core\job_spec.lua @ 72: jobs changes to given `cwd` directory
    C:/projects/neovim/test/functional\core\job_spec.lua:81: Expected objects to be the same.
    Passed in:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0' } } }
    Expected:
    (table) {
      [1] = 'notification'
      [2] = 'stdout'
     *[3] = {
        [1] = 0
       *[2] = {
          [1] = 'C:\projects\neovim\Xtest-tmpdir\nvimmSjq1S\0'
         *[2] = '' } } }
    stack traceback:

Message chunking is non-deterministic, so we need to try different
variants.
2018-02-18 19:19:03 +01:00
George Zhao
499c9a1553 test/win: fix some environment assumptions #7912
fix #7909
fix #7910
2018-01-28 19:10:18 +01:00
Justin M. Keyes
c095f83116 api: change nvim_command_output behavior
Implement nvim_command_output with `execute({cmd},"silent")`.

Behavior changes:
- does not provoke any hit-enter prompt
- no longer prepends a newline char
- does not capture some noise (like the "[New File]" message, see the
  change to tabnewentered_spec.lua)

Technically ("bug-for-bug") this a breaking change.  But the previous
behavior of nvim_command_output meant that it probably wasn't used for
anything outside of tests.

Also remove the undocumented `v:command_output` variable which was
a hack introduced only for the purposes of nvim_command_output.

closes #7726
2018-01-10 23:45:44 +01:00
Justin M. Keyes
8c2cb81d7e
test: set_shell_powershell(): update flags (#7819) 2018-01-07 16:20:37 +01:00
Jan Edmund Lazo
a1adfdc7d5 ci: nodejs client acceptance-test #7706
ci: install nodejs 8 in Appveyor, Travis

provider: check node version for debug support
Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix.

provider: test if nodejs in ci supports --inspect-brk

nodejs host for neovim requires nodejs 6+ to work properly.
nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`.

provider: run cli.js of nodejs host directly

npm shims are useless because the user cannot set node to debug mode via
--inspect-brk. This is problematic on Windows which use batchfiles and
shell scripts to compensate for not supporting shebang.

The patch uses `npm root -g` to get the absolute path of the global npm
modules. If that fails, then the user did not install neovim npm package
globally. Use that absolute path to find `neovim/bin/cli.js`, which is
what the npm shim actually runs with node. glob() is for a simple file
check in case bin/ is removed because the npm shims are ignored now.
2017-12-17 16:09:18 +01:00
Justin M. Keyes
5f288220f9 test: write_file(): support append-mode 2017-12-05 01:46:41 +01:00
Justin M. Keyes
7f386b175c test: retry(): fix time calculation
libuv caches the results of uv.now() until the next loop tick. If a test
does not spin the libuv event loop, retry() enters an infinite cycle.
2017-12-05 01:46:40 +01:00
Justin M. Keyes
944e3c0619 tui: expose terminal type in 'term' option
Since "builtin" terminfo definitions were implemented (7cbf52db1b),
the decisions made by tui.c and terminfo.c are more relevant. Exposing
that decision in the 'term' option helps with troubleshooting.

Also: remove code that allowed setting t_Co. `:set t_Co=…` has never
worked; the highlight_spec test asserting that nvim_set_option('t_Co')
_does_ work makes no sense, and should not have worked.
2017-11-27 09:45:32 +01:00
Björn Linse
91b856ccce channels: tests 2017-11-26 09:17:04 +01:00
Björn Linse
8540b5e4ad test: add hexdump utilitiy function 2017-11-25 09:37:00 +01:00
Justin M. Keyes
efb0aca0ee test/helpers: disable powershell logo/banner message 2017-08-06 02:51:48 +02:00
Justin M. Keyes
1b70a1da04 Merge #6958 from ZyX-I/fix-6957 2017-07-04 21:56:05 +02:00
ZyX
91b9ad7d82 shada: Make sure that code does not attempt to read too long items
Fixes #6957
2017-07-04 15:41:59 +03:00
ZyX
2208b64891 functests: Ensure different SIDs on successive source() calls 2017-07-04 15:15:23 +03:00
Justin M. Keyes
f34befe74c Merge #6789 from ZyX-I/lua-path
lua: Add paths from &runtimepath to package.path and package.cpath
2017-06-27 02:29:15 +02:00
ZyX
d5839770ee functests: Refactor redir_exec 2017-06-20 18:17:47 +03:00
Justin M. Keyes
b4b09afabd test: iswin(): detect without nvim session 2017-06-07 00:27:26 +02:00
Björn Linse
6a75938758 channels: implement sockopen() to connect to socket
Helped-By: oni-link <knil.ino@gmail.com>
2017-05-29 19:02:49 +02:00
ZyX
97602371e6 lua: Add paths from &runtimepath to package.path and package.cpath 2017-05-25 16:27:40 +03:00
ZyX
19d38c4d0f functests: Replace check_provider -> missing_provider with err report 2017-05-13 03:06:50 +03:00
ZyX
8b171b8c50 functests: Test invalid behaviour
Test correctly fail for oneline ruby, python and python3.
2017-05-13 03:06:30 +03:00
ZyX
09f849b600 Merge branch 'master' into luaviml'/lua 2017-05-08 15:43:45 +03:00
Justin M. Keyes
3ea1007753 api: nvim_get_mode()
Asynchronous API functions are served immediately, which means pending
input could change the state of Nvim shortly after an async API function
result is returned.

nvim_get_mode() is different:
  - If RPCs are known to be blocked, it responds immediately (without
    flushing the input/event queue)
  - else it is handled just-in-time before waiting for input, after
    pending input was processed. This makes the result more reliable
    (but not perfect).

Internally this is handled as a special case, but _semantically_ nothing
has changed: API users never know when input flushes, so this internal
special-case doesn't violate that. As far as API users are concerned,
nvim_get_mode() is just another asynchronous API function.

In all cases nvim_get_mode() never blocks for more than the time it
takes to flush the input/event queue (~µs).

Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if
e.g. `d` is operator-pending.

Closes #6159
2017-04-28 19:14:34 +02:00
Justin M. Keyes
10f119ab87 Merge #6539 'More cursor shape modes' 2017-04-21 19:09:50 +02:00
Björn Linse
48f0542ad6 tests: detect invalid helpers.sleep 2017-04-21 14:21:26 +02:00
Rui Abreu Ferreira
799443c994 win/test: Enable more system() tests 2017-04-12 02:10:33 +02:00
Justin M. Keyes
2d29638744 test: :file {name} 2017-04-11 00:39:12 +02:00
Justin M. Keyes
6cbf290d56 test/rmdir(): fallback to Nvim delete()
Lua has too many pitfalls here:
- os.execute() requires shell-escaping
- os.execute() has breaking changes between Lua 5.1 and 5.2
- No native way in Lua to handle "readonly" etc. on Windows
2017-04-11 00:39:12 +02:00
Justin M. Keyes
0ce9618918 test/rmdir(): Remove readonly attr on Windows. 2017-04-10 22:59:30 +02:00
ZyX
ab4d13e2fa Merge branch 'master' into luaviml'/lua 2017-04-10 22:21:06 +03:00
ZyX
dbe67868b5 Merge branch 'master' into rename-execute 2017-04-09 19:14:20 +03:00
ZyX
69d1003bf7 functests: Fix some tests which are failing locally for unrelated reasons 2017-04-09 03:24:14 +03: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
a34408ef7f test: retry(): Report number of retries. (#6475)
tui_spec.lua: Retry the terminal-mode test.
2017-04-09 02:11:08 +02:00
ZyX
e31aab8b61 functests: Refactor legacy/029_join test 2017-04-08 22:00:50 +03:00
ZyX
043d8ff9f2 Merge branch 'master' into luaviml'/lua 2017-04-08 01:54:58 +03:00
ZyX
9dd0d4f8b9 unittests: Add trace description right to the error message 2017-04-01 12:52:28 +03:00
Matthew Malcomson
66b336d89b test: set 'nomore' by default (#6360)
Escaping from a '-- More --' prompt in tests is awkward as it doesn't
take keys from the typebuffer, requiring a call to `feed()` in lua at
the correct time. Moreover, it's rarer that a test will want the
'-- More --' prompt to be activated than not.
2017-03-30 19:00:34 +02:00
ZyX
5239616297 functests: Fix buf_functions test on Windows 2017-03-29 10:08:44 +03:00
ZyX
140cd0da1d functests: Fix “function has more then 60 upvalues” error 2017-03-27 00:12:23 +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
Matthieu Coudron
5ed753044d test: Refactor fold tests (#5993) 2017-02-28 09:34:02 +01:00
Justin M. Keyes
c318d8e672 Merge #6112 from ZyX-I/split-eval'/buf_get_changedtick
Better b:changedtick support
2017-02-27 10:29:46 +01:00
Justin M. Keyes
8c8ce1832e Merge #6111 from ZyX-I/split-eval'/os-fileio
Refactor writefile() and create more tests for it
2017-02-27 10:20:25 +01:00
ZyX
858ac9d8e5 api: Make sure dict_set_var doesn’t edit read-only values
Fixes #6147
2017-02-23 19:48:41 +03:00