Commit Graph

561 Commits

Author SHA1 Message Date
Sean Dewar
3137c7d635
feat(eval/method): partially port v8.1.1925
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- getcwd(): requires chdir() and Test_chdir_func() from v8.1.1291.

Note that the method call tests for getreg() and getregtype() were
removed in v8.2.1547, which has already been ported, but doesn't seem to
have been replaced with a new test...

This patch also makes getchangelist()'s argument optional (defaults to
the current buffer).

eval.txt includes a typo for gettabwinvar(), which is fixed in
v8.1.1952.
2021-10-03 20:06:32 +01:00
Sean Dewar
6110480c29
feat(eval/method): partially port v8.1.1921
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- filereadable(): requires v8.1.1378 for Test_delete_rf(), but there
                  appears to have been some trouble porting it. (#12784)

- confirm(): requires v8.1.0832 for Test_confirm() and v8.1.0815 for
             feedkeys()'s "L" flag.

             (I did attempt to port the test using nvim_input() instead,
             but seems that input handling for confirm() doesn't work in
             --headless mode?)

             Note that confirm() was actually added as a method in
             v8.1.1915.

Uncomment use of method call syntax in Test_Executable() previously
included instead from v8.2.2259.
2021-10-03 20:06:31 +01:00
Sean Dewar
0193b3a391
vim-patch:8.1.1336: some eval functionality is not covered by tests
Problem:    Some eval functionality is not covered by tests.
Solution:   Add a few more test cases. (Masato Nishihata, closes vim/vim#4374)
17aca707f9

Test_expand() changes are required for v8.1.1921.
Test_call() and Test_cindent_func() are already ported.
2021-10-03 20:06:31 +01:00
Sean Dewar
f9779facca
vim-patch:8.2.0924: cannot save and restore a register properly
Problem:    Cannot save and restore a register properly.
Solution:   Add getreginfo() and make setreg() accept a dictionary. (Andy
            Massimino, closes vim/vim#3370)
bb861e293e

Cherry-pick eval.txt changes for getreginfo() from:
6aa57295cf
207f009326
2021-09-23 02:04:11 +01:00
Justin M. Keyes
2afbce7651
refactor(tests): remove redir_exec #15718
Problem
- `redir_exec` is obsolete, but it keeps getting used in new tests
  because people copy existing tests.
- Disadvantages of `redir_exec`:
  - Captures extra junk before the actual error/message that we _want_ to test.
  - Does not fail on error, unlike e.g. `command()`.

Solution
- Use new functions like `nvim_exec` and `pcall_err`.
2021-09-19 02:29:37 -07:00
Justin M. Keyes
6751d6254b
refactor(tests): use assert_alive() #15546 2021-09-01 09:42:53 -07:00
Justin M. Keyes
4c499899b2
Merge #15293 Vimscript "method" syntax
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}
2021-08-26 04:26:32 -07:00
Gregory Anders
d8ab8cccd0 test: update tests to work with 'hidden' 2021-08-18 12:17:12 -06:00
Sean Dewar
7925f0b633
vim-patch:8.1.1909: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make a few more functions usable as a method.
e49fbff384
2021-08-12 22:35:24 +01:00
Sean Dewar
287a77ef51
vim-patch:8.1.1861: only some assert functions can be used as a method
Problem:    Only some assert functions can be used as a method.
Solution:   Allow using most assert functions as a method.
24278d2407

Port tests to assert_spec.lua.
2021-08-12 22:35:22 +01:00
Björn Linse
f0cc3a9480 refactor(options): remove obsolete distinction of "vi" vs "vim" defaults
It might come as a schocking surprise, but the defaults we support
are the NEOVIM defaults.
2021-07-14 21:54:19 +02:00
Daniel Steinberg
936f3a4ddc
test/memory_usage_spec: skip on MacOS #15043
Memory compression could complicate the measurements.
2021-07-10 20:15:38 -07:00
Daniel Steinberg
8bd6990084
vim-patch:8.2.1905: the wininfo list may contain stale entries (#14884)
Problem:    The wininfo list may contain stale entries.
Solution:   When closing a window remove any other entry where the window
            pointer is NULL.
4882d98339
2021-06-30 21:24:50 -04:00
Jan Edmund Lazo
d3bdde0bad
test: clear $GZIP, use nvim's system() (#14791) 2021-06-12 13:05:43 -04:00
shadmansaleh
687eb0b39f feat(startup): Source runtime/plugin/**/*.lua at startup
For opt plugins these files are sourced on `:packadd`

* `:runtime` Now can exexute lua files
2021-06-11 00:58:38 +06:00
Jan Edmund Lazo
59d550345d
vim-patch:8.2.2778: problem restoring 'packpath' in session
Problem:    Problem restoring 'packpath' in session.
Solution:   Let "skiprtp" also apply to 'packpath'.
d23b714d8b

Port Test_mksession_skiprtp() to lua functional test.
2021-05-22 17:32:24 -04:00
Marco Hinz
4ba3d059bf
Revert "vim-patch:8.1.1378: delete() can not handle a file name that looks like a pattern (#12784)"
This reverts commit 4be0e92db0.

Unfortunately, that commit stalled the Windows builds on GHA and likely requires
other patches to work properly.
2021-05-12 00:47:21 +02:00
Jan Edmund Lazo
d2be261e8d
Merge pull request #14403 from seandewar/vim-8.2.1933
vim-patch:8.2.{0174,1933,1935,1946,2286,2287}
2021-05-09 17:08:21 -04:00
Shougo
4be0e92db0
vim-patch:8.1.1378: delete() can not handle a file name that looks like a pattern (#12784)
Problem:    Delete() can not handle a file name that looks like a pattern.
Solution:   Use readdir() instead of appending "/*" and expanding wildcards.
            (Ken Takata, closes vim/vim#4424, closes vim/vim#696)
701ff0a3e5
2021-05-07 08:07:13 -04:00
Sean Dewar
96f62394cf
vim-patch:8.2.0174: various commands not completely tested
Problem:    Various commands not completely tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5551)
5d98dc2a48
2021-04-20 01:50:56 +01:00
Jan Edmund Lazo
9e4c1fa073
vim-patch:8.2.2601: memory usage test often fails on FreeBSD
Problem:    Memory usage test often fails on FreeBSD.
Solution:   Increase multiplier for upper limit.
6bce5856b5
2021-03-14 11:54:36 -04:00
Jan Edmund Lazo
a1cdb6ca6a
vim-patch:8.2.2595: setting 'winminheight' may cause 'lines' to change
Problem:    Setting 'winminheight' may cause 'lines' to change.
Solution:   Also take minimal height of other tabpages into account. (vim/vim#7899)
9e813b3dea
2021-03-13 10:16:23 -05:00
Jan Edmund Lazo
f32acc70e8
vim-patch:8.2.2236: 'scroll' option can change when setting the statusline
Problem:    'scroll' option can change when setting the statusline or tabline
            but the option context is not updated.
Solution:   Update the script context when the scroll option is changed as a
            side effect. (Christian Brabandt, closes vim/vim#7533)
746670604a
2021-03-02 00:35:52 -05:00
Jan Edmund Lazo
e50875b3e3
vim-patch:8.2.2560: setting 'winminheigt' does not take tabline into account
Problem:    Setting 'winminheigt' does not take tabline into account.
Solution:   Subtract the tabline from the available height. (closes vim/vim#7899)
39d4cab494

N/A patches for version.c:

vim-patch:8.1.0680: not easy to see what features are unavailable

Problem:    Not easy to see what features are unavailable.
Solution:   Highlight disabled features in the :version output. (Nazri Ramliy,
            closes vim/vim#3756)
c85ffc9dab

vim-patch:8.2.2196: :version output has extra spaces in compile and link command

Problem:    :version output has extra spaces in compile and link command.
Solution:   Adjust QUOTESED. (closes vim/vim#7505)
abcbb0e9ad

vim-patch:8.2.2551: MS-Windows: colors test file is not installed

Problem:    MS-Windows: colors test file is not installed.
Solution:   Also copy runtime/colors/tools. (Ken Takata, closes vim/vim#7902)
d0bce504ec

vim-patch:8.2.2559: MS-Windows: guifont test fails on Windows XP

Problem:    MS-Windows: guifont test fails on Windows XP.
Solution:   Check windowsversion().
3650fd7098
2021-03-01 23:40:39 -05:00
Jan Edmund Lazo
5b897acfc1
test/old: restore test_backspace_opt.vim
Porting it to test/functional/legacy/backspace_opt_spec.lua
was a mistake.
Tests pass after commenting out some lines for Vi compatibility.

File is copied from Vim as of patch v8.2.0540.
Patch v8.2.0540 cannot be fully ported yet.
This file is a prequisite for future v8.2.x patches.
2021-01-05 09:47:38 -05:00
Jan Edmund Lazo
52bfaea70e
test/win: skip vargs memory usage on Github Actions
This test can fail on any of the Windows builds
because Github Actions does not provide enough stability
and enough memory for all runners..

Check test requirements before running any test cases
to avoid duplicate checks.
2021-01-01 17:13:43 -05:00
erw7
5cf94effee
test, legacy/assert_spec.lua: fix few tests fail
Adjust failing tests to current behavior due to changes in assert_fails
behavior by fbd6a86.
2021-01-01 04:58:05 -05:00
Jan Edmund Lazo
925ddd2839
vim-patch:8.2.1925: list/dict test fails
Problem:    List/dict test fails.
Solution:   Correct expected exception.
6d967125ad

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)
0289065e41

vim-patch:8.2.1932: compiler warnings when building with Athena GUI

Problem:    Compiler warnings when building with Athena GUI.
Solution:   Fix function signatures.
963734e316
2020-11-01 09:28:33 -05:00
Jan Edmund Lazo
3d6584223d
vim-patch:8.2.0131: command line is not cleared when switching tabs
Problem:    Command line is not cleared when switching tabs and the command
            line height differs.
Solution:   Set the "clear_cmdline" flag when needed. (Naruhiko Nishino,
            closes vim/vim#5495)
479950f6c9
2020-10-29 18:36:38 -04:00
Björn Linse
07cc231142 A Mudholland Dr. Recast
The commit summary maybe does not make sense, but calling a function
that does not wait on anything `wait()` makes even less sense.
2020-10-19 21:48:06 +02:00
Aufar Gilbran
a893593a9f
vim-patch:8.2.1488: text does not scroll when inserting above first line
Problem:    Text does not scroll when inserting above first line.
Solution:   Adjust off-by-one error. (Ken Takata, closes vim/vim#6739)
9dc1917f42
2020-10-07 23:41:50 +08:00
Aufar Gilbran
e852bad3a7
vim-patch:8.2.1345: Redraw error when using visual block and scroll
Problem:    Redraw error when using visual block and scroll.
Solution:   Add check for w_topline. ( closes vim/vim#6597)
f8992d47cd
2020-10-07 23:41:38 +08:00
Aufar Gilbran
77bb48e740 vim-patch:8.1.0295: no 'incsearch' highlighting for :vimgrep and similar
Problem:    No 'incsearch' highlighting for :vimgrep and similar commands.
Solution:   Parse the :vimgrep command and similar ones to locate the search
            pattern. (Hirohito Higashi, closes vim/vim#3344)
264cf5cfaf
2020-09-11 10:33:20 +08:00
Aufar Gilbran
ab7e101540 vim-patch:8.1.0291: 'incsearch' highlighting not used for :sort
Problem:    'incsearch' highlighting not used for :sort.
Solution:   Handle pattern in :sort command.
81f56536b1
2020-09-11 10:33:20 +08:00
Jan Edmund Lazo
45615cedd1
vim-patch:8.2.1472: ":argdel" does not work like ":.argdel" as documented
Problem:    ":argdel" does not work like ":.argdel" as documented. (Alexey
            Demin)
Solution:   Make ":argdel" work like ":.argdel". (closes vim/vim#6727)
            Also fix giving the error "0 more files to edit".
7b22117c4e
2020-08-17 23:34:39 -04:00
Jan Edmund Lazo
1e6bf6f17a
vim-patch:8.2.0072: memory test still fails on Cirrus CI
Problem:    Memory test still fails on Cirrus CI.
Solution:   Allow for a tiny bit more tolerance in the upper limit.
bb062c1588

Check memory usage after  Neovim sourced the Vimscript files.
https://github.com/neovim/neovim/pull/12679

N/A patches for version.c:

vim-patch:8.2.0062: memory test is flaky on FreeBSD

Problem:    Memory test is flaky on FreeBSD.
Solution:   Add a short sleep before getting the first size.
e7538ae997

vim-patch:8.2.0071: memory test often fails on Cirrus CI

Problem:    Memory test often fails on Cirrus CI.
Solution:   Allow for more tolerance in the upper limit.  Remove sleep.
1832d12aea
2020-08-02 12:00:00 -04:00
Jan Edmund Lazo
e16f2cbd12
vim-patch:8.2.0539: comparing two NULL list fails
Problem:    Comparing two NULL list fails.
Solution:   Change the order of comparing two lists.
7b293c730b

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.
c85156bb89

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)
6d3a7213f5

vim-patch:8.2.1196: build failure with normal features

Problem:    Build failure with normal features.
Solution:   Add #ifdef.
83e7450053

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.
a4b442614c
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
ab69ea26dc
vim-patch:8.1.0819: a failed assert with a long string is hard to read
Problem:    A failed assert with a long string is hard to read.
Solution:   Shorten the assert message.
865767126e
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
909af2f3f1
vim-patch:8.2.0491: cannot recognize a <script> mapping using maparg()
Problem:    Cannot recognize a <script> mapping using maparg().
Solution:   Add the "script" key. (closes vim/vim#5873)
2da0f0c445
2020-06-04 20:52:53 -04:00
erw7
7ac46b5d37 vim-patch:8.1.1435: memory usage test is a bit too flaky
Problem:    Memory usage test is a bit too flaky.
Solution:   Adjust the tolerances a bit. (Christian Brabandt)
5d508dd39e
2020-05-07 16:48:08 +09:00
erw7
a32bac0c04 vim-patch:8.1.1058: memory usage test may still fail on some systems
Problem:    Memory usage test may still fail on some systems.
Solution:   Use 98% of the lower limit. (Christian Brabandt)
3a731ee0c2
2020-05-07 16:48:08 +09:00
erw7
6b3399338f vim-patch:8.1.1037: memory usage test may still fail on some systems
Problem:    Memory usage test may still fail on some systems.
Solution:   Increase tolerance from 3% to 20%.
6b6f7aae4a
2020-05-07 16:48:08 +09:00
erw7
7acdc9da1d vim-patch:8.1.1033: memory usage test may still fail on some systems
Problem:    Memory usage test may still fail on some systems. (Elimar
            Riesebieter)
Solution:   Increase tolerance from 1% to 3%.
ba64ba0935
2020-05-07 16:48:08 +09:00
erw7
6175d974c2 vim-patch:8.1.1031: memory usage test may still fail
Problem:    Memory usage test may still fail.
Solution:   Drop the unused min value. (Christian Brabandt)
f7e47af776
2020-05-07 16:48:08 +09:00
erw7
9ad2ba1c5c vim-patch:8.1.1027: memory usage test sometimes fails
Problem:    Memory usage test sometimes fails.
Solution:   Use 80% of before.last as the lower limit. (Christian Brabandt)
08cda65ddf
2020-05-07 16:48:08 +09:00
erw7
1212390254 vim-patch:8.1.1007: using closure may consume a lot of memory
Problem:    Using closure may consume a lot of memory.
Solution:   unreference items that are no longer needed. Add a test. (Ozaki
            Kiichi, closes vim/vim#3961)
209b8e3e3b
2020-05-07 16:47:41 +09:00
Jan Edmund Lazo
eba8a9ca1d
vim-patch:8.1.1510: a plugin cannot easily expand a command like done internally
Problem:    A plugin cannot easily expand a command like done internally.
Solution:   Add the expandcmd() function. (Yegappan Lakshmanan, closes vim/vim#4514)
80dad48c50
2020-03-01 03:57:58 -05:00
erw7
3557757a3c vim-patch:8.1.0092: prompt buffer test fails
Problem:    Prompt buffer test fails.
Solution:   Set 'nomodified' before closing the window. (Ozaki Kiichi,
            closes vim/vim#3051
71ef1ba5e9
2020-02-12 16:03:54 +09:00
erw7
783aecd501 vim-patch:8.1.0036: not restoring Insert mode if leaving prompt buffer with mouse
Problem:    Not restoring Insert mode if leaving a prompt buffer by using a
            mouse click.
Solution:   Set b_prompt_insert appropriately. Also correct cursor position
            when moving cursor to last line.
891e1fd894
2020-02-12 15:16:32 +09:00
erw7
3ca0343fb9 vim-patch:8.1.0032: BS in prompt buffer starts new line
Problem:    BS in prompt buffer starts new line.
Solution:   Do not allows BS over the prompt.  Make term_sendkeys() handle
            special keys. Add a test.
6b810d92a9
2020-02-12 15:16:32 +09:00