aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval
Commit message (Collapse)AuthorAge
* win: default shellxescape, shellxquote to emptyRui Abreu Ferreira2017-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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')
* win: libuv_process_spawn(): special-case cmd.exeRui Abreu Ferreira2017-04-12
| | | | | | | | | | | | | | | | | | 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
* win/test: Enable more system() testsRui Abreu Ferreira2017-04-12
|
* functests: Fix some tests which are failing locally for unrelated reasonsZyX2017-04-09
|
* functests: Replace execute with either command or feed_commandZyX2017-04-09
| | | | | | | | | | 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.
* win: os_get_hostname() #5416 (#6413)Justin M. Keyes2017-04-07
|
* eval: Add s flag, use p_fs by default, error out on unknown flagZyX2017-04-03
|
* functests: Try sleeping a bit moreZyX2017-03-29
|
* eval: Fix extend() behaviour with NULL lists and dictionariesZyX2017-03-29
| | | | | Ref #4615 Ref vim/vim#768
* eval/typval: Fix SEGV in test_alot.vim testZyX2017-03-29
|
* eval: Move part of dictwatcher* functions to eval/typvalZyX2017-03-29
|
* functests: Fix buf_functions test on WindowsZyX2017-03-29
|
* eval/typval: Add tv_list_equal() tests, compare NULL lists equalZyX2017-03-29
|
* eval/typval,tests: Fix extending list with itself, add testsZyX2017-03-29
| | | | | Adds unit test for tv_list_extend and regression test for extend() VimL function.
* eval/typval: Make tv_list_concat handle NULL lists correctlyZyX2017-03-29
| | | | Fixes some FIXMEs in eval/null_spec.lua.
* functests: Add null_spec.lua from #4615ZyX2017-03-29
| | | | | | For now it is full of FIXMEs and tests for incorrect behaviour. Sorted out to have FIXMEs in one place, commented crashing tests in other and correctly working tests in the third one.
* eval: Fix max_min functionsZyX2017-03-29
| | | | | | Found two bugs: 1. Multiple unneeded error messages, vim/vim#1039. 2. Unformatted error string, vim/vim#1040.
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* eval: Move get_tv_lnum and get_tv_float to eval/typval.hZyX2017-03-29
| | | | | | | | | Additionally - Rename former tv_get_float to tv_get_float_chk due to name conflict (former get_tv_float is better suited for being tv_get_float). - Add E907 error to get_tv_float() and test that it is being raised when appropriate.
* eval: Make setmatches() return -1 in case of some failuresZyX2017-03-29
|
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* functests: Add tests for some *buf* functionsZyX2017-03-29
|
* test/let_spec: self-referencing List. (#6228)Justin M. Keyes2017-03-08
| | | Regression test coverage for #6070.
* test: backtick expansion #6218Justin M. Keyes2017-03-06
|
* Merge #6112 from ZyX-I/split-eval'/buf_get_changedtickJustin M. Keyes2017-02-27
|\ | | | | Better b:changedtick support
| * *: Fix linter errorsZyX2017-02-23
| |
| * api: Make sure dict_set_var doesn’t edit read-only valuesZyX2017-02-23
| | | | | | Fixes #6147
| * eval: Forbid (un)locking b:changedtickZyX2017-02-23
| | | | | | Port of vim-patch:8.0.0343
| * eval: Make sure `islocked('b:.changedtick')` does not error outZyX2017-02-23
| | | | | | Port of vim-patch:8.0.0345
| * eval: Specify more precise len for var_check_ro in get_lvalZyX2017-02-23
| |
| * functests: Add some more testsZyX2017-02-23
| |
| * buffer: Forbid unletting b:changedtickZyX2017-02-23
| |
| * eval: Refactor item_lockZyX2017-02-23
| | | | | | If I am not mistaking, this commit should not change any functionality.
| * eval: Make sure that b:changedtick may not be unlocked via :unlo b:varZyX2017-02-23
| | | | | | It still may be unlocked by `:unlock b:.var`.
| * functests: Add testsZyX2017-02-23
| | | | | | Contains a number of FIXMEs.
* | Merge #6111 from ZyX-I/split-eval'/os-fileioJustin M. Keyes2017-02-27
|\ \ | |/ |/| Refactor writefile() and create more tests for it
| * eval: Fix error messages from writefileZyX2017-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. When calling writefile(list, fname, []) do not show error message twice. 2. Do not allow file name to be overwritten for writefile([1], 2). 3. Do not show “Can’t open file with an empty name” error after error like “using Float as a String” when type of the second argument is not correct. 4. Do not give multiple error messages and still continue for code like `writefile(["test", [], [], [], "tset"])`. Note that to fix 4. ideally I need tv_check_str_or_nr which is currently present in two PRs: #6114 and #5119. I would want to avoid copying this function into a yet another PR. Ref vim/vim#1476.
| * eval: writefile: Give more adequate IO errors and do not call putc()ZyX2017-02-14
| |
* | eval.c: has("unnamedplus"). (#6136)Kurt Bonatz2017-02-18
| | | | | | | | | | Return 1 for UNIX with a functioning clipboard provider. Closes #6103
* | *: Partial string handling refactoringZyX2017-02-15
|/ | | | | | | | Main points: - Replace `char_u` with `char` in some cases. - Remove `str[len] = NUL` hack in some cases when `str` may be considered `const`.
* eval: Add id() function and make printf("%p") return something useful (#6095)Nikolai Aleksandrovich Pavlov2017-02-11
|
* test: executable(): AppVeyor: Ignore "sibling" failureJustin M. Keyes2017-02-04
| | | | | This test sometimes fails on AppVeyor, but we still want to exercise the code path and get at least a "soft" notification in the pending list.
* win: executable(): full path without extensionJustin M. Keyes2017-02-04
| | | | Absolute path is considered executable even *without* an extension.
* vim-patch:8.0.0280Justin M. Keyes2017-02-04
| | | | | | | | | | patch 8.0.0280: problem setting multi-byte environment var on MS-Windows Problem: On MS-Windows setting an environment variable with multi-byte strings does not work well. Solution: Use wputenv when possible. (Taro Muraoka, Ken Takata) 7c23d1d9d9cc
* win: Append process dir to $PATHJustin M. Keyes2017-02-04
| | | | | | | | This allows executables to be found by :!, system(), and executable() if they live next to ("sibling" to) nvim.exe. This is what gvim on Windows does, and also matches the behavior of Win32 SearchPath(). https://github.com/vim/vim/blob/c4a249a736d40ec54794827ef95804c225d0e38f/src/os_win32.c#L354-L370
* test: executable()Rui Abreu Ferreira2017-02-04
|
* Merge pull request #6050 from jamessan/fix-xclip-testsJames McCoy2017-02-03
|\ | | | | Fix xclip tests to cleanup on their own
| * test: Turn printargs_path into a functionJames McCoy2017-02-02
| | | | | | | | | | | | | | | | | | | | 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.
| * test: Make xclip exit after one selection requestJames McCoy2017-02-02
| | | | | | | | Closes #4900
* | test: execute() + :redirJustin M. Keyes2017-02-01
| |