| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Subdirectories like "visual", "insert", "normal" encourage people to
separate *related* tests for no good reason. Typically the _mode_ is
not the relevant topic of a test (and when it is, _then_ create
an appropriate describe() or it()).
Solution:
- Delete the various `test/functional/<mode>/` subdirectories, move
their tests to more meaningful topics.
- Rename `…/normal/` to `…/editor/`.
- Move or merge `…/visual/*` and `…/insert/*` tests into here where
appropriate.
- Rename `…/eval/` to `…/vimscript/`.
- Move `…/viml/*` into here also.
* test(reorg): insert/* => editor/mode_insert_spec.lua
* test(reorg): cmdline/* => editor/mode_cmdline_spec.lua
* test(reorg): eval core tests => eval_spec.lua
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that
* Shell uses UTF8 input/output mode
* Stderr output is captured, in UTF8
* Program exit codes are correctly captured
Update functional test harness and add tests
for :make command.
Closes #13713
|
|
|
|
|
|
|
|
|
|
| |
* tv_to_argv: error when cmd is not executable
Callers always assume that emsg was emitted:
- https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L12509
- https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L17923
- https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L18202
* test/functional/provider: display reason from missing_provider
* provider#node#Detect: skip / handle non-existing node executable
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is perfectly fine and expected to detach from the screen just by
the UI disconnecting from nvim or exiting nvim. Just keep detach() in
screen_basic_spec, to get some coverage of the detach method itself.
This avoids hang on failure in many situations (though one could argue
that detach() should be "fast", or at least "as fast as resize",
which works in press-return already).
Never use detach() just to change the size of the screen, try_resize()
method exists for that specifically.
|
|
|
| |
Removed 'echo' alias because it does not behave like POSIX echo.
|
|
|
|
|
|
|
|
|
| |
* tests: move os_kill to functional helpers
* tests: fix system_spec when run with clipboard manager
Replaces "xclip" with a dedicated helper program.
Fixes: https://github.com/neovim/neovim/issues/4900#issuecomment-501866842
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: When user tries to exit with CTRL-C message is confusing.
Solution: Only mention ":qa!" when there is a changed buffer. (closes vim/vim#4163)
https://github.com/vim/vim/commit/a84a3dd6635fcd2e07f510cba6a999585dcc381a
vim-patch:8.1.1052: test for CTRL-C message sometimes fails
Problem: test for CTRL-C message sometimes fails
Solution: Make sure there are no changed buffers.
https://github.com/vim/vim/commit/553e5a5c568e7d175b65b0472cd6d9843b25f4c8
vim-patch:8.1.1053: warning for missing return statement
Problem: Warning for missing return statement. (Dominique Pelle)
Solution: Add return statement.
https://github.com/vim/vim/commit/d6c3f1fa2b5e1dd7dc87cf608d72b84ad696b58f
|
|
|
|
|
|
|
|
| |
It would previously fail with `set shell=sh` (no slash).
For the test itself we can just use a non-existing (fake) shell, because
it is only about the verbose output.
Ref: https://github.com/neovim/neovim/issues/9330
|
|
|
|
|
|
|
|
| |
ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790
Steps to reproduce:
:set verbose=9
:call system(['echo'])
E730: using List as a String
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
closes #8362
Vim's code calls `call_shell` directly from `get_system_output_as_rettv`
whereas in Nvim this function has been rewritten to not call `call_shell` but to call
`os_system` via `do_os_system`, losing the support for profiling and verbose.
Changing the code to call `call_shell` from `get_system_output_as_rettv`
seems to be too complicated to be worth it on the current version of the
code. So this commit duplicates the relevant code.
|
|
|
|
|
|
|
|
| |
Problem: For some people the hint about quitting is not sufficient.
Solution: Put <Enter> separately. Also use ":qa!" to get out even when
there are changes.
https://github.com/vim/vim/commit/28a8193e3113f676f89fb6312b099d849df881d3
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
closes #7698
Wrapping a command in double-quotes allows cmd.exe to safely dequote the
entire command as if the user entered the entire command in an
interactive prompt. This reduces the need to escape nested and uneven
double quotes.
The `/s` flag of cmd.exe makes the behaviour more reliable:
:set shellcmdflag=/s\ /c
Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to
cmd.exe `echo` builtin) even if it is wrapped in double quotes.
Example:
:: internal echo
> cmd /s /c " echo foo\:bar" "
foo\:bar"
:: cygwin echo.exe
> cmd /s /c " "echo" foo\:bar" "
foo:bar
|
| |
|
|
|
|
|
|
|
|
|
| |
Test failure:
test/functional/eval/system_spec.lua: "works with an empty string"
E5677: Error writing input to shell-command: EPIPE
ref https://github.com/neovim/neovim/pull/6558#issuecomment-361061035
ref #6554
|
|
|
|
|
|
|
|
| |
When tv_get_string_chk returns a non-NULL value, we have a valid string.
Propagating an error state (*len = -1, NULL return) for an empty string
is invalid.
Closes #6554
|
|
|
|
|
|
|
| |
For the test to be valid it should actually send input.
ref #3529
ref #5241
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vim-patch:8.0.0151
Problem: To pass buffer content to system() and systemlist() one has to
first create a string or list.
Solution: Allow passing a buffer number. (LemonBoy,
closes vim/vim#1240)
https://github.com/vim/vim/commit/12c4492dd35e0cd83c8816be2ec849b836109882
vim-patch:8.0.0153
Problem: system() test fails on MS-Windows.
Solution: Deal when extra space and CR.
https://github.com/vim/vim/commit/9d9c35651712b88c81f1ae11091de1fd0bbbd35c
vim-patch:8.0.0154
Problem: system() test fails on OS/X.
Solution: Deal with leading spaces.
https://github.com/vim/vim/commit/31f19ce0a052f7c76d44a9a190e468c79cf5d56d
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling cmd.exe in Windows follows a very different pattern from Vim.
The primary difference is that Vim does a nested call to cmd.exe, e.g.
the following call in Vim
system('echo a 2>&1')
spawns the following processes
"C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1)
C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1
^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1)
C:\Windows\system32\cmd.exe /c (echo a 2>&1
>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1)
The escaping with ^ is needed because cmd.exe calls itself and needs to
preserve the special metacharacters for the last call. However in nvim
no nested call is made, system('') spawns a single cmd.exe process.
Setting shellxescape to "" disables escaping with ^.
The previous default for shellxquote=( wrapped any command in
parenthesis, in Vim this is more meaningful due to the use of tempfiles
to store the output and redirection (also see &shellquote). There is
a slight benefit in having the default be empty because some expressions
that run in console will not run within parens e.g. due to unbalanced
double quotes
system('echo "a b')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disable CommandLineToArgvW-standard quoting for cmd.exe.
libuv assumes spawned processes follow the convention expected by
CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe:
- With system([]), the caller has full control (and responsibility) to
quote arguments correctly.
- With system(''), shell* options are used.
libuv quoting is disabled if argv[0] is:
- cmd.exe
- cmd
- $COMSPEC resolving to a path with filename cmd.exe
Closes #6329
References #6387
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
When test/functional/eval/system_spec.lua is run on its own,
helpers.os_name() was being called before a session had been created.
This caused that describe block to fail.
Turning printargs_path into a function delays the call of
helpers.os_name() until the test is being run, which ensures a session
is available.
|
|
|
|
| |
Closes #4900
|
| |
|
|
|
|
|
|
|
|
| |
Do _not_ set v:shell_error on parameter validation error.
system([...]) does not invoke a shell, so this change is somewhat
questionable. But `:help v:shell_error` is sufficiently vague to allow
-1 in this case.
|
| |
|
| |
|
|
Closes #3529
Closes #5241
In Vim,
:echo system('cat - &', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).
In Nvim,
:echo system('cat - &', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.
This still works:
:%w !tee > foo1358.txt &
but this does not:
:%w !tee foo1358.txt &
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
|