aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval
Commit message (Collapse)AuthorAge
* test: reorg #15698Justin M. Keyes2021-09-17
| | | | | | | | | | | | | | | | | | | | 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
* feat(f_msgpackparse): support parsing from BlobSean Dewar2021-09-16
| | | | | | | | | Note that it is not possible for msgpack_unpack_next() and msgpack_unpacker_next() to return MSGPACK_UNPACK_EXTRA_BYTES, so it should be fine to abort() on that. Lua 5.1 doesn't support string hex escapes (\xXX) like VimL does (though LuaJIT does), so convert them to decimal escapes (\DDD) in tests.
* feat(f_msgpackdump): support dumping to BlobSean Dewar2021-09-16
|
* vim-patch:8.2.0404: writefile() error does not give a hintSean Dewar2021-09-15
| | | | | | Problem: Writefile() error does not give a hint. Solution: Add remark about first argument. https://github.com/vim/vim/commit/18a2b87ca27c378a555b20f14a284d2ce3511427
* vim-patch:8.1.0793: incorrect error messages for functions that take a BlobSean Dewar2021-09-15
| | | | | | | Problem: Incorrect error messages for functions that now take a Blob argument. Solution: Adjust the error messages. (Dominique Pelle, closes vim/vim#3846) https://github.com/vim/vim/commit/0d17f0d1c09fa6db306336695ba646c21ea24909
* feat(decode_string): decode binary string with NULs to BlobSean Dewar2021-09-15
| | | | | | | | Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
* feat(msgpack): convert Blobs to BIN stringsSean Dewar2021-09-15
|
* feat(json): convert Blobs to array of byte valuesSean Dewar2021-09-15
| | | | | Similiar to how Vim does it, but to be consistent with how Nvim encodes lists, add a space after every comma.
* feat(api): convert Blobs to API stringsSean Dewar2021-09-15
| | | | Note that these are not NUL-terminated; the API supports this.
* vim-patch:8.1.0735: cannot handle binary dataSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot handle binary data. Solution: Add the Blob type. (Yasuhiro Matsumoto, closes vim/vim#3638) https://github.com/vim/vim/commit/6e5ea8d2a995b32bbc5972edc4f827b959f2702f Nvim-specific Blob conversions are implemented in future commits. Refactor write_blob() to use a FileDescriptor, as f_writefile() was refactored to use one (does not apply to read_blob()). Use var_check_lock() in f_add() for Blobs from v8.1.0897. Add a modeline to test_blob.vim and fix some doc typos. Include if_perl.txt's VIM::Blob() documentation. Interestingly, this function already worked before this port, as it just returns a Blob string literal, not an actual Blob object. N/A patches for version.c: vim-patch:8.1.0741: viminfo with Blob is not tested Problem: Viminfo with Blob is not tested. Solution: Extend the viminfo test. Fix reading a blob. Fixed storing a special variable value. https://github.com/vim/vim/commit/8c8b8bb56c724cc1bfc3d8520eec33f2d399697c vim-patch:8.1.1022: may use NULL pointer when out of memory Problem: May use NULL pointer when out of memory. (Coverity) Solution: Check for blob_alloc() returning NULL. https://github.com/vim/vim/commit/e142a9467a7f6845a426d8db6efedf246d3c13ac
* refactor(tests): use assert_alive() #15546Justin M. Keyes2021-09-01
|
* Merge #15293 Vimscript "method" syntaxJustin M. Keyes2021-08-26
|\ | | | | Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
| * fix(eval): cherry-pick emsg changes from v8.1.0736Sean Dewar2021-08-12
| | | | | | | | | | | | | | | | | | | | | | v8.1.0736 made some changes for making some emsgs more specific. Includes the change for Test_lambda_fails() in test_lambda.vim. Adjust relevant functionaltests to expect the new emsgs. This patch has been fully ported in my Blob port PR, but it hasn't been merged yet, so just use what we need from it for now. Required for v8.1.1821.
* | Merge pull request #15422 from bfredl/syn_name2id_go_brrBjörn Linse2021-08-19
|\ \ | | | | | | feat(highlights): some improvements and perf fixes
| * | feat(match): allow hl group to be defined after :match commandBjörn Linse2021-08-19
| |/
* / test: update tests to work with 'hidden'Gregory Anders2021-08-18
|/
* doc(options): Fix recommended PowerShell config (#14349)Dimitri Tcaciuc2021-07-02
| | | | | | | | | | | 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
* clang/API: reject null string in timer_start()Jan Edmund Lazo2021-06-02
|
* vim-patch:8.2.0946: cannot use "q" to cancel a number promptJan Edmund Lazo2021-05-21
| | | | | | Problem: Cannot use "q" to cancel a number prompt. Solution: Recognize "q" instead of ignoring it. https://github.com/vim/vim/commit/eebd555733491cb55b9f30fe28772c0fd0ebacf7
* vim-patch:8.1.1967: line() only works for the current windowJan Edmund Lazo2021-05-12
| | | | | | Problem: Line() only works for the current window. Solution: Add an optional argument for the window to use. https://github.com/vim/vim/commit/8e0a8e7eb7c177807f44db6b76d8e52314248ab5
* eval: add v:_null_stringJan Edmund Lazo2021-04-08
| | | | | | | | | | Replacement for Vim's test_null_string(). Vim uses it to verify that its codebase handles null strings. Preparation for the Test_null_list() in patch v8.2.1822. Use v:_null_string, not non-existent env var, for null string tests. Mention v:_null_string in id() because id(v:_null_string) returns (nil).
* Use uv_os_homedir and current directory as backup when $HOME is not set (#13657)ffanzhang2021-01-10
| | | | | | Close https://github.com/neovim/neovim/issues/8614 Use uv_os_homedir and current directory as backup if HOME env is not set. Allocate homedir only if var is not NULL.
* Revert "vim-patch:8.1.0822: peeking and flushing output slows down execution"Jan Edmund Lazo2020-12-31
| | | | This reverts commit 0519a75f6eca1065a4d0184f99c71ae03a99b9b1.
* vim-patch:8.1.0822: peeking and flushing output slows down executionJan Edmund Lazo2020-12-25
| | | | | | | Problem: Peeking and flushing output slows down execution. Solution: Do not update the mode message when global_busy is set. Do not flush when only peeking for a character. (Ken Takata) https://github.com/vim/vim/commit/cb574f415486adff645ce384979bfecf27f5be8c
* test: textlock api errornotomo2020-12-16
|
* test/functional/eval: assert that executable() fixtures are executableJan Edmund Lazo2020-12-11
|
* eval: executable(), exepath() accept strings onlyJan Edmund Lazo2020-12-11
| | | | | | | | Cherry-pick f_executable(), f_exepath(), check_for_string() from patch 8.2.2117. Rename check_for_string() to tv_check_for_string(). https://github.com/vim/vim/commit/7bb4e74c38642682cfdd0cb4052adfa5efdd7dd1 Close https://github.com/neovim/neovim/issues/13485
* vim-patch:8.2.0047: cannot skip tests for specific MS-Windows platform (#13461)Jan Edmund Lazo2020-12-11
| | | | | Problem: Cannot skip tests for specific MS-Windows platform. Solution: Add windowsversion(). https://github.com/vim/vim/commit/0c1e3744ff0cd6c17af773046b876b428ff3dded
* test/timer_spec: increase base timeoutJan Edmund Lazo2020-12-01
| | | | | | | | | | | | | The following keeps happening in my local environment because the timeout is too short. [ FAILED ] test/functional/eval/timer_spec.lua @ 208: timers do not crash when processing events in the handler test/functional/eval/timer_spec.lua:219: retry() attempts: 1 test/helpers.lua:73: Expected objects to be the same. Passed in: (number) 0 Expected: (number) 1
* feat(lua): improve error message to make it actionable (#13276)Alvaro Muñoz2020-11-13
| | | * improve error message to make it actionable
* vim-patch:8.2.1925: list/dict test failsJan Edmund Lazo2020-11-01
| | | | | | | | | | | | | | | | | | | | | | Problem: List/dict test fails. Solution: Correct expected exception. https://github.com/vim/vim/commit/6d967125ad87b1c2a9467357286c3514d5dd1c40 Cherry-pick e_dictkey[] change from patch 8.2.1924. N/A patches for version.c: vim-patch:8.2.1929: MS-Windows: problem loading Perl 5.32 Problem: MS-Windows: problem loading Perl 5.32. Solution: Define NO_THREAD_SAFE_LOCALE. (Ken Takata, closes vim/vim#7234) https://github.com/vim/vim/commit/0289065e41ce3148f929e16a55aa3b161c80576f vim-patch:8.2.1932: compiler warnings when building with Athena GUI Problem: Compiler warnings when building with Athena GUI. Solution: Fix function signatures. https://github.com/vim/vim/commit/963734e316bd17dd7290abcac28b875435d06381
* A Mudholland Dr. RecastBjörn Linse2020-10-19
| | | | | The commit summary maybe does not make sense, but calling a function that does not wait on anything `wait()` makes even less sense.
* vim-patch:8.2.0539: comparing two NULL list failsJan Edmund Lazo2020-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Comparing two NULL list fails. Solution: Change the order of comparing two lists. https://github.com/vim/vim/commit/7b293c730b07d1586688e622b8d9cbbb4a52379b N/A patches for version.c: vim-patch:8.2.1187: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Disable Test_zz2_terminal_guioptions_bang() for now. https://github.com/vim/vim/commit/c85156bb897085d7f5a8e4e180287f87bf19b948 vim-patch:8.2.1188: memory leak with invalid json input Problem: Memory leak with invalid json input. Solution: Free all keys at the end. (Dominique Pellé, closes vim/vim#6443, closes vim/vim#6442) https://github.com/vim/vim/commit/6d3a7213f58da834b0fc869d05f87e86010c66cf vim-patch:8.2.1196: build failure with normal features Problem: Build failure with normal features. Solution: Add #ifdef. https://github.com/vim/vim/commit/83e7450053399942e1c9efa802c568b51d948541 vim-patch:8.2.1198: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Move test function to terminal3 to see if the problem moves too. https://github.com/vim/vim/commit/a4b442614c5ca4ebf32acf5cf0b7b718496f1c94
* Merge pull request #12455 from janlazo/vim-8.0.1554Matthieu Coudron2020-06-22
|\ | | | | [RDY]vim-patch:8.0.1554,8.1.1977,8.2.{927,930,932,938,954,963,964,966,980,983,998,999}
| * vim-patch:8.2.0966: 'shortmess' flag "n" not used in two placesJan Edmund Lazo2020-06-18
| | | | | | | | | | | | | | Problem: 'shortmess' flag "n" not used in two places. Solution: Make use of the "n" flag consistent. (Nick Jensen, closes vim/vim#6245, closes vim/vim#6244) https://github.com/vim/vim/commit/722e505d1a55dfde5ab62241d10da91d2e10c3c1
* | eval: fix assertion failure in garbage collection (#12436)erw72020-06-22
|/ | | | | | | | | | | | | | | | | | | | | | | * eval: fix assertion failure in garbage collection fixes #12387, #12430 Lists with CopyID+1 linked only from previous_funccal may be removed in the garbage collection. Therefore, the terms of the assertions are not correct. This can be confirmed by the following (The l:x with CopyID+1 of the first function call needs to be removed by garbage collection): func! s:f() let l:x = [1] let g:x = l: endfunc for _ in range(2) call s:f() endfor call garbagecollect() " press any key * test: add test for #12387, #12430
* vim-patch:8.2.0111: VAR_SPECIAL is also used for booleansBilly Su2020-06-06
| | | | | | Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking. https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
* vim-patch:8.2.0491: cannot recognize a <script> mapping using maparg()Jan Edmund Lazo2020-06-04
| | | | | | Problem: Cannot recognize a <script> mapping using maparg(). Solution: Add the "script" key. (closes vim/vim#5873) https://github.com/vim/vim/commit/2da0f0c445da3c9b35b2a0cd595d10e81ad2a6f9
* lua: move test helper function, map and filter, to vim.shared moduleHirokazu Hata2020-02-18
|
* API: include invalid buffer/window/tabpage in error message (#11712)Daniel Hahler2020-01-14
|
* system(), jobstart(): raise error on non-executable #11234Daniel Hahler2019-12-24
| | | | | | | | | | * 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
* tests: let_spec: enable "multibyte env var to child process" (#11233)Daniel Hahler2019-10-18
|
* tests/ui: remove unnecessary screen:detach()Björn Linse2019-10-13
| | | | | | | | | | | | | 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.
* fnamemodify: fix handling of :r after :e #11165Rob Pilling2019-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Test fnamemodify() - Test handling of `expand("%:e:e:r")`. - Fix :e:e:r on filenames with insufficiently many extensions During `fnamemodify()`, ensuring that we don't go before the filename's tail is insufficient in cases where we've already handled a ":e" modifier, for example: ``` "path/to/this.file.ext" :e:e:r:r ^ ^-------- *fnamep +------------- tail ``` This means for a ":r", we'll go before `*fnamep`, and outside the bounds of the filename. This is both incorrect and causes neovim to exit with an allocation error. We exit because we attempt to calculate `s - *fnamep` (line 23948). Since `s` is before `*fnamep`, we caluclate a negative length, which ends up being interpreted as an amount to allocate, causing neovim to exit with ENOMEM (`memory.c:xmalloc`). We must instead ensure we don't go before `*fnamep` nor `tail`. The check for `tail` is still relevant, for example: ``` "path/to/this.file.ext" :r:r:r ^ ^------------- tail +--------------------- *fnamep ``` Here we don't want to go before `tail`. close #11165
* test: "!:&" works with powershell #11201Jan Edmund Lazo2019-10-10
| | | Removed 'echo' alias because it does not behave like POSIX echo.
* tests: retry: "wait() evaluates the condition on given interval" (#11155)Daniel Hahler2019-10-06
| | | Ref: https://github.com/neovim/neovim/issues/11137
* Revert "win/os_env_exists(): workaround libuv bug #10734"Daniel Hahler2019-09-25
| | | | This reverts commit 278c5d452c2cbc436a9cc317407ae6021a226c3a.
* timer_spec: fix/harden flaky tests (#11080)Daniel Hahler2019-09-24
| | | | | | | | | | | | | | | | | | | | | | Those are flaky when using luacov (which causes reproducible slowness). E.g.: [ ERROR ] test/functional\eval\timer_spec.lua @ 105: timers can invoke redraw in blocking getchar() call test\functional\ui\screen.lua:587: Row 3 did not match. Expected: |ITEM 1 | |ITEM 2 | |*{1:~ }| |{1:~ }| |{1:~ }| |^ | Actual: |ITEM 1 | |ITEM 2 | |*ITEM 3 | |{1:~ }| |{1:~ }| |^ |
* Context: rename "buflist" => "bufs"Justin M. Keyes2019-09-14
| | | | | Given the other type names "jumps", "vars", etc., the name "buflist" is somewhat unintuitive.
* tests: fix system_spec when run with clipboard manager (#10956)Daniel Hahler2019-09-12
| | | | | | | | | * 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