Commit Graph

863 Commits

Author SHA1 Message Date
zeertzjq
63df91c10a
vim-patch:8.2.1046: insufficient tests for src/buffer.c (#19903)
Problem:    Insufficient tests for src/buffer.c.
Solution:   Add more tests.  Move comments related tests to a separate file.
            (Yegappan Lakshmanan, closes vim/vim#6325)
b7e2483655
2022-08-23 11:24:46 +08:00
zeertzjq
b7c86e24f7 vim-patch:8.2.0982: insufficient testing for reading/writing files
Problem:    Insufficient testing for reading/writing files.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6257)
            Add "ui_delay" to test_override() and use it for the CTRL-O test.
b340baed9f

Omit test_override().
Reorder test_writefile.vim to match Vim.
2022-08-19 22:05:26 +08:00
zeertzjq
cf3b871fa9
test: use poke_eventloop() instead of sleep(10) where possible (#19794)
Using sleep(10) to wait for typeahead to finish is flaky, especially on
macOS, where legacy/global_spec.lua has failed several times.
2022-08-16 15:21:46 +08:00
zeertzjq
76b4b1977b vim-patch:8.2.1799: some Normal mode commands not fully tested
Problem:    Some Normal mode commands not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#7073)
d1ad99b654

Cherry-pick test_registers.vim change from patch 8.2.0644.
2022-08-15 20:24:43 +08:00
zeertzjq
55da52963b vim-patch:8.2.5109: mode not updated after CTRL-O CTRL-C in Insert mode
Problem:    Mode not updated after CTRL-O CTRL-C in Insert mode.
Solution:   Set redraw_mode and use it. (closes vim/vim#10581)
7a1d32809b
2022-08-15 17:58:35 +08:00
zeertzjq
93ba821831 vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc
Problem:    Mode is not cleared when leaving Insert mode with mapped Esc.
Solution:   Clear the mode when redraw_cmdline is set. (closes vim/vim#4269)
4c25bd785a
2022-08-15 17:58:35 +08:00
zeertzjq
53b0688ac0 vim-patch:8.1.1189: mode is not cleared when leaving Insert mode
Problem:    Mode is not cleared when leaving Insert mode.
Solution:   Clear the mode when got_int is set. (Ozaki Kiichi, closes vim/vim#4270)
abc7c7fc5a
2022-08-15 17:58:35 +08:00
zeertzjq
d31ee6664d
test: increse expect_exit() timeouts (#19680)
A timeout of 100 milliseconds is sometimes still too short for macOS.
Change it to 1000 milliseconds.
2022-08-08 22:04:21 +08:00
zeertzjq
d0686540f5 vim-patch:8.2.1280: Ex command error cannot contain an argument
Problem:    Ex command error cannot contain an argument.
Solution:   Add ex_errmsg() and translate earlier.  Use e_trailing_arg where
            possible.
8930caaa1a

Remove duplicate test file 062_tab_pages_spec.lua
2022-08-07 14:38:57 +08:00
zeertzjq
6963c2bdcd vim-patch:8.2.0815: maparg() does not provide enough information for mapset()
Problem:    maparg() does not provide enough information for mapset().
Solution:   Add "lhsraw" and "lhsrawalt" items.  Drop "simplified"
9c65253fe7

vim-patch:9.0.0127: unused variable

Problem:    Unused variable.
Solution:   Remove the variable. (closes vim/vim#10829)
e95f22f63a
2022-08-01 21:54:18 +08:00
zeertzjq
0ae94a128f test: rewrite Test_missing_attr() in Lua 2022-07-31 08:51:20 +08:00
zeertzjq
f254fc67a5
vim-patch:9.0.0099: scrollback can be wrong after redrawing the command line (#19562)
Problem:    Scrollback can be wrong after redrawing the command line.
Solution:   Clear unfinished scrollback when redrawing. (closes vim/vim#10807)
46af7bc08d
2022-07-28 20:07:32 +08:00
zeertzjq
fc55f8263c vim-patch:9.0.0086: tabline is not redrawn when entering command line
Problem:    Tabline is not redrawn when entering command line.
Solution:   Set "redraw_tabline". (closes vim/vim#10771)
6791adca53
2022-07-27 06:32:40 +08:00
zeertzjq
9f1dc1466e vim-patch:9.0.0082: cannot interrupt global command from command line
Problem:    Cannot interrupt global command from command line.
Solution:   Reset got_int in another place. (closes vim/vim#10739)
3cfae39b08
2022-07-27 06:19:43 +08:00
zeertzjq
45e2bbae83 vim-patch:9.0.0051: using CTRL-C wih :append may hang Vim
Problem:    Using CTRL-C wih :append may hang Vim.
Solution:   Reset got_int. (closes vim/vim#10729, closes vim/vim#10728)
f754fe6a3d
2022-07-27 06:19:43 +08:00
zeertzjq
fe159d23fd
vim-patch:9.0.0071: command overlaps with printed text in scrollback (#19505)
Problem:    Command overlaps with printed text in scrollback.
Solution:   Clear until end-of-line and use correct message chunk.
            (closes vim/vim#10765, closes vim/vim#10764)
ecdc82e74e

N/A patches for version.c:

vim-patch:9.0.0070: using utfc_ptr2char_len() when length is negative

Problem:    Using utfc_ptr2char_len() when length is negative.
Solution:   Check value of length. (closes vim/vim#10760)
4dc513a22c
2022-07-26 07:30:33 +08:00
zeertzjq
72dfd57e5f test: deal with RPC call causing Nvim to exit later 2022-07-19 19:41:07 +08:00
zeertzjq
366e90cdc8 test: avoid timing-sensitive undo message 2022-07-19 19:41:07 +08:00
zeertzjq
7b835ba796
vim-patch:8.2.1147 (#19425)
vim-patch:8.2.1147: :confirm may happen in cooked mode

Problem:    :confirm may happen in cooked mode. (Jason Franklin)
Solution:   Switch to raw mode before prompting. (Brandon Pfeifer)
27321dbeed

Code is N/A, but this improves tests. Port the improved tests to Lua.
2022-07-19 13:00:22 +08:00
zeertzjq
0cfd4fa8f3 vim-patch:8.2.2643: various code not covered by tests
Problem:    Various code not covered by tests.
Solution:   Add a few more test. (Yegappan Lakshmanan, closes vim/vim#7995)
1f448d906b

Cherry-pick some test_edit.vim changes from patches 8.2.{1022,1432}.
Reorder test_undo.vim to match upstream.
2022-07-16 22:46:54 +08:00
zeertzjq
780edfc0eb vim-patch:8.2.2608: character input not fully tested
Problem:    Character input not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#7963)
f4fcedc59d

Cherry-pick related changes from patches 8.2.{0433,0866}.
2022-07-16 21:55:27 +08:00
zeertzjq
bc73795a58 vim-patch:8.2.0198: no tests for y/n prompt
Problem:    No tests for y/n prompt.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#5564)
43c60eda2a
2022-07-16 21:32:25 +08:00
zeertzjq
f7c6676199 vim-patch:8.2.0052: more-prompt not properly tested
Problem:    More-prompt not properly tested.
Solution:   Add a test case. (Dominique Pelle, closes vim/vim#5404)
c6d539b671
2022-07-16 21:32:25 +08:00
zeertzjq
465b73c3a5 vim-patch:8.2.0482: channel and sandbox code not sufficiently tested
Problem:    Channel and sandbox code not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5855)
ca68ae1311

Cherry-pick test_clientserver.vim changes form patch 8.2.0448.
2022-07-15 10:50:21 +08:00
zeertzjq
c01690b1ea
fix(exmode): flush messages before printing a line after pressing Enter (#19341) 2022-07-13 09:06:31 +08:00
zeertzjq
4aa4675fbf vim-patch:8.2.0293: various Ex commands not sufficiently tested
Problem:    Various Ex commands not sufficiently tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5673)
818fc9ad14

Needs to assert E170 instead of E580 because patch 8.2.3486 has been
ported but patch 8.2.1183 hasn't.
2022-07-12 16:23:32 +08:00
zeertzjq
01afd43bc9 vim-patch:8.2.0275: some Ex code not covered by tests
Problem:    Some Ex code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5659)
406cd90f19
2022-07-12 16:23:32 +08:00
zeertzjq
1abdb3224b vim-patch:8.2.2732: prompt for s///c in Ex mode can be wrong
Problem:    Prompt for s///c in Ex mode can be wrong.
Solution:   Position the cursor before showing the prompt. (closes vim/vim#8073)
e5b0b98a90
2022-07-12 14:08:34 +08:00
zeertzjq
d079995fb8 vim-patch:8.2.0270: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5649)
bc2b71d44a
2022-07-12 14:08:34 +08:00
zeertzjq
53392f48b1 vim-patch:8.2.0203: :helptags and some other functionality not tested
Problem:    :helptags and some other functionality not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5567)
e20b9ececa
2022-07-12 11:52:47 +08:00
zeertzjq
27fd17a79c vim-patch:8.2.0243: insufficient code coverage for ex_docmd.c functions
Problem:    Insufficient code coverage for ex_docmd.c functions.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5618)
9f6277bdde

Cherry-pick Test_window_only() from patch 8.2.0203.
Cherry-pick a memory leak fix from patch 8.2.0399.
2022-07-12 05:36:33 +08:00
zeertzjq
8ea09fc908
vim-patch:8.2.4378: incsearch HL broken when calling searchcount in 'tabLine' (#19147)
Problem:    Incsearch highlight broken when calling searchcount() in 'tabLine'
            function. (Mirko Palmer)
Solution:   Save and restore the incsearch state. (Christian Brabandt,
            closes vim/vim#9763, closes vim/vim#9633)
6dd7424c7e
2022-06-29 19:34:37 +08:00
bfredl
e3281d992e fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
zeertzjq
ab1f96e1d5
vim-patch:8.2.5064: no test for what 8.1.0052 fixes (#18881)
Problem:    No test for what 8.1.0052 fixes.
Solution:   Add a test. (closes vim/vim#10531)
3760bfddc4
2022-06-07 00:19:57 +08:00
dundargoc
ff20d40321
docs: fix typos (#18269)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dan Sully <dan+github@sully.org>
Co-authored-by: saher <msaher.shair@gmail.com>
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
Co-authored-by: Benedikt Müller <d12bb@posteo.de>
Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
2022-06-04 11:56:36 +08:00
Javier Lopez
f914b4e7a8
test: fixeol cleanup created files #18785
The async nature of feed_command caused a race condition on the calls
to delete, leaving the files on the root of the repo. Just use os.remove
and no need to wipeout.
2022-05-28 10:34:18 -07:00
Gregory Anders
9e1ee9fb1d
refactor!: delete insertmode (#18547)
Neovim already removed `evim` (or any similar flags). The 'insertmode'
option is a weird remnant, so get rid of it.

The 'insertmode' option is replaced with a script that closely emulates
the option. This script is documented at :help 'insertmode'
2022-05-22 21:20:18 -06:00
bfredl
3c1bc75447 fix(tests): fix some screen.lua warnings 2022-05-21 23:07:34 +02:00
Famiu Haque
bbf58e6bbc refactor(ui)!: link VertSplit to Normal by default
Avoids using `gui=reverse` on `VertSplit` and makes window separators
look much nicer by default.
2022-05-15 22:37:35 +06:00
zeertzjq
c196119acb
vim-patch:8.2.2797: Search highlight disappears in the Visual area (#17947)
Problem:    Search highlight disappears in the Visual area.
Solution:   Combine the search attributes. (closes vim/vim#8134)
2d5f385cee
2022-05-13 21:20:15 +08:00
zeertzjq
65df08aade test: convert two statusline oldtests to Lua screen tests 2022-05-10 08:15:46 +08:00
zeertzjq
2ba539f449
fix(input): only disable mapped CTRL-C interrupts when getting input (#18310) 2022-04-30 13:11:35 +08:00
zeertzjq
68ddbdd03b test(old): revert changes from ed88ca7503
Copy test_regex_char_classes.vim from upstream to avoid future encoding
problems.
2022-04-29 15:51:03 +08:00
zeertzjq
519e4c4472 test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
zeertzjq
48a35106ef vim-patch:8.2.4818: no test for what 8.2.4806 fixes
Problem:    No test for what 8.2.4806 fixes.
Solution:   Add a test. (closes vim/vim#10727)
ac92ab7719

Test cannot be used because it must use test_setmouse(). Use a Lua test.
2022-04-25 07:23:24 +08:00
zeertzjq
c72857d396 vim-patch:8.2.0358: insufficient testing for indent.c
Problem:    Insufficient testing for indent.c.
Solution:   Add indent tests. (Yegappan Lakshmanan, closes vim/vim#5736)
bd7206e02c

Cherry-pick Test_ex_mode() changes from Vim patches 8.2.{0342,0347}.
Reorder test_expand_func.vim to match upstream.
2022-04-21 07:24:47 +08:00
zeertzjq
2a2c4e191f
vim-patch:8.2.4718: @@@ in the last line sometimes drawn in the wrong place (#18055)
Problem:    @@@ in the last line sometimes drawn in the wrong place.
Solution:   Make sure the column is valid. (closes vim/vim#10130)
cee9c844f2
2022-04-10 04:50:49 +08:00
bfredl
402a71ff87
Merge pull request #17335 from famiu/fix/ui/win-resize
fix: Make window resize commands manage cmdheight
2022-04-05 19:34:06 +02:00
bfredl
6dc31eea43 fix(tests): update legacy tab switch test to be sane 2022-04-05 16:50:11 +02:00
Famiu Haque
463174b5d7 fix(ui): make window resize commands manage cmdheight
Previously, the window resize commands did not resize the value of `cmdheight` when they caused a change in the topframe height, leaving a gap between the end of topframe and the start of the command line, this commit fixes that by making window resize commands automatically change the value of cmdheight if the resize affects the height of topframe.
2022-04-05 16:50:07 +02:00
zeertzjq
969d600f2a
vim-patch:8.2.{4692,4691,4690}: fix Insert mode <LeftDrag> mapping bug (#17999)
vim-patch:8.2.4692: no test for what 8.2.4691 fixes

Problem:    No test for what 8.2.4691 fixes.
Solution:   Add a test.  Use a more generic sotlution. (closes vim/vim#10090)
0f68e6c07a

Test cannot be used because it must use test_setmouse(). Use a Lua test.

Reverted patches:

vim-patch:8.2.4691: solution for <Cmd> in a mapping causes trouble

Problem:    Solution for <Cmd> in a mapping causes trouble.
Solution:   Use another solution: put back CTRL-O after reading the <Cmd>
            sequence.
ca9d8d2cb9

vim-patch:8.2.4689: using <Cmd> in a mapping does not work for mouse keys

Problem:    Using <Cmd> in a mapping does not work for mouse keys in Insert
            mode. (Sergey Vlasov)
Solution:   When reading the <Cmd> argument do not use the stuff buffer.
            (closes vim/vim#10080)
d0fb2d8041
2022-04-05 21:38:53 +08:00
Shougo
e9e16655af
[RFC] vim-patch:8.1.1378: delete() can not handle a file name that looks li… (#16268)
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

Cherry-pick a change to Test_delete_rf() from patch 8.1.1921.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-04-03 20:27:46 +08:00
zeertzjq
8a6cf51a71
vim-patch:8.2.3122: with 'nowrap' cursor position is unexected in narrow window (#17935)
Problem:    With 'nowrap' cursor position is unexected in narrow window.
            (Leonid V.  Fedorenchik)
Solution:   Put cursor on the last non-empty line. (closes vim/vim#8525)
30441bb3d5
2022-04-01 07:11:38 +08:00
zeertzjq
86f81c471a vim-patch:8.2.4577: message test is flaky
Problem:    Message test is flaky. (Elimar Riesebieter)
Solution:   Trigger the autocommand event only after startup is finished.
9323ca51c2
2022-03-31 10:05:26 +08:00
zeertzjq
5a3a1304e1 vim-patch:8.2.4200: some tests do not clean up properly
Problem:    Some tests do not clean up properly.
Solution:   Delete created files. (Yegappan Lakshmanan, closes vim/vim#9611)
7e765a39b7

Omit test_filetype.vim: already ported
Omit test_vim9_import.vim: N/A
2022-03-31 10:05:26 +08:00
zeertzjq
d5dee83552 vim-patch:8.2.4156: fileinfo message overwrites echo'ed message
Problem:    Fileinfo message overwrites echo'ed message.
Solution:   Reset need_fileinfo when displaying a message. (Rob Pilling,
            closes vim/vim#9569)
726f7f91fd
2022-03-31 10:05:26 +08:00
zeertzjq
47630743fc vim-patch:8.2.1844: using "q" at the more prompt doesn't stop a long message
Problem:    Using "q" at the more prompt doesn't stop a long message.
Solution:   Check for "got_int". (closes vim/vim#7122)
3d30af8783

Cherry-pick file name change from patch 8.2.2112.
2022-03-31 10:05:26 +08:00
Justin M. Keyes
72652cbc46
feat(test): use nvim_exec in helpers.source() #16064
helpers.source() was a hack to work around the lack of anonymous
:source. Its "create tempfile" behavior is not a required part of most
tests that use it.

Some tests still need the old "create tempfile" behavior either because
they test SID behavior, or because of missing nvim_exec features: #16071
2022-03-27 10:25:55 -07:00
zeertzjq
9530c2d6d8
vim-patch:8.2.4626: Visual area not updated when removing sign in Visual mode (#17864)
Problem:    Visual area not fully updated when removing sign in Visual mode
            while scrolling.
Solution:   Adjust check for topline. (closes vim/vim#10017)
abb6fbd14d
2022-03-26 08:52:54 +08:00
bfredl
ed88ca7503 feat(input): enable <tab>/<c-i>, <cr>/<c-m>, <esc>/<c-[> pairs unconditionally 2022-03-24 11:02:39 +01:00
zeertzjq
d7488bf386 feat(input)!: delay some conversions to vgetc() 2022-03-24 11:02:39 +01:00
zeertzjq
0442635a50 test(autochdir_spec): use better patterns 2022-03-07 06:43:03 +08:00
zeertzjq
eb70540ff0 vim-patch:8.2.4513: window-local directory is not applied if 'acd' fails
Problem:    Window-local directory is not applied if 'acd' fails.
Solution:   Don't call do_autochdir(). (closes vim/vim#9891)
b29ae15977
2022-03-07 06:43:03 +08:00
zeertzjq
da9bc96152 vim-patch:8.2.3920: restoring directory after using another window is inefficient
Problem:    Restoring directory after using another window is inefficient.
Solution:   Only restore the directory for win_execute().  Apply 'autochdir'
            only when needed.
90c317f224
2022-03-07 06:43:03 +08:00
zeertzjq
8262de0b48 vim-patch:8.2.3739: in wrong directory when using win_execute() with 'acd' set
Problem:    In wrong directory when using win_execute() with 'acd' set.
Solution:   Restore the directory when returning to the window. (closes vim/vim#9276)
dea4a61637
2022-03-07 06:43:03 +08:00
zeertzjq
78bb8c4ee7 test(old): add more missing test files and run more tests alone
Copy four files from Vim v8.2.1432.
Try to match Vim's test_alot.vim.
This marks Vim patch 8.2.0164 as ported:

vim-patch:8.2.0164: test_alot takes too long

Problem:    Test_alot takes too long.
Solution:   Run several tests individually.
842931cd7a
2022-03-03 13:23:08 +08:00
zeertzjq
62a1290758 vim-patch:8.2.3661: test for put with large count fails
Problem:    Test for put with large count fails.
Solution:   Adjust the counts in the test.
8bc07e800c
2022-02-18 09:48:35 +08:00
zeertzjq
3ed800e998 vim-patch:8.2.3659: integer overflow with large line number
Problem:    Integer overflow with large line number.
Solution:   Check for overflow. (closes vim/vim#9202)
03725c5795

Put E1247 in globals.h as E1240 is also there.
Do not make getdigits() abort.
2022-02-18 09:48:00 +08:00
Sean Dewar
41d0e7af20
vim-patch:8.2.3601: check for overflow in put count does not work well
Problem:    Check for overflow in put count does not work well.
Solution:   Improve the overflow check. (Ozaki Kiichi, closes vim/vim#9102)
fa53722367

Add some casts as Nvim uses size_t variables in some places.

We could technically adjust the logic to check for overflow outside of size_t's
range, but it's much easier to just port the patch exactly (also means we can
use the same tests).

v:sizeoflong is N/A, so convert the 64-bit tests to Lua and use the FFI to check
long's size.
2022-02-17 17:06:16 +00:00
Sean Dewar
edc5554fc4
Merge pull request #17402 from seandewar/vim-8.2.4120
vim-patch:8.2.{3073,4120,4151,4152}
2022-02-15 00:30:05 +00:00
Sean Dewar
2b75ac7aa9
vim-patch:8.2.4152: block insert with double wide character fails
Problem:    Block insert with double wide character fails.
Solution:   Adjust the expected output.
fc6ccebea6
2022-02-14 17:29:49 +00:00
zeertzjq
5220891571 vim-patch:8.2.4343: when reloading not all properties are detected
Problem:    When reloading not all properties are detected.
Solution:   Add the "edit" value to v:fcs_choice. (Rob Pilling, closes vim/vim#9579)
8196e94a8b

Cherry-pick some test changes from patch 8.1.1826.
2022-02-14 11:35:25 +08:00
zeertzjq
b16fae0f26 test(old): add test_cdo.vim and test_packadd.vim
test_cdo.vim is copied from Vim v8.1.1483.
test_packadd.vim is copied from Vim v8.2.0174.
2022-02-13 10:26:11 +08:00
zeertzjq
2a6a93b665 test(old): move some tests from assert_spec.lua to test_assert.vim 2022-02-13 09:23:20 +08:00
zeertzjq
5546492c44 test: convert Test_file_changed_dialog() to Lua functional test 2022-02-11 20:37:20 +08:00
zeertzjq
68603998b9 test: add Lua functional tests for Ex mode 2022-02-08 14:47:23 +08:00
zeertzjq
fe621b4ac0 vim-patch:8.1.0711: test files still use function!
Problem:    Test files still use function!.
Solution:   Remove the exclamation mark.  Fix overwriting a function.
1e1153600c

Some of the changes were already applied previously.
2022-02-07 05:34:20 +08:00
zeertzjq
a4078fa57e test(old): add test_expand.vim
This removes expand_spec.lua and copies test_expand.vim from Vim at
version v8.1.2278.

The rest of patch 8.1.2278 were already applied in #15952, so this marks
that patch as fully ported.

vim-patch:8.1.2278: using "cd" with "exe" may fail

Problem:    Using "cd" with "exe" may fail.
Solution:   Use chdir() instead.
3503d7c94a
2022-02-05 16:41:23 +08:00
zeertzjq
2fd0720de2 test: convert some search stat screendump tests to Lua screen tests 2022-02-04 18:47:20 +08:00
zeertzjq
ef5cd99df0 test: remove 003_cindent_spec.lua
This no longer needed as Vim patch 8.1.1434 has been ported.
2022-01-31 15:44:54 +08:00
zeertzjq
f2d84df4a8 vim-patch:8.2.3095: with 'virtualedit' set to "block" block selection is wrong
Problem:    With 'virtualedit' set to "block" block selection is wrong after
            using "$".  (Marco Trosi)
Solution:   Compute the longest selected line. (closes vim/vim#8495)
b17ab86e7b
2022-01-27 18:55:21 +08:00
zeertzjq
296b8fbe3b vim-patch:8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Problem:    'listchars' "exceeds" character appears in foldcolumn. Window
            separator is missing. (Leonid V.  Fedorenchik)
Solution:   Only draw the "exceeds" character in the text area.  Break the
            loop when not drawing the text. (closes vim/vim#8524)
41fb723ee9
2022-01-21 18:16:16 +08:00
Daniel Steinberg
cc62f3d6cb
test: make test for #14040 more stable (#16911) 2022-01-04 07:25:28 -07:00
Sean Dewar
70a68dc2c5
fix(options): disallow empty 'fdc' and 'scl' (#16765)
Empty string values for these options aren't actually allowed, but
check_opt_strings allows empty string options.

It so happens that 'scl' handles empty string like "auto", but empty 'fdc'
causes glitchiness (win_fdccol_count returns an incorrect value).

Just disallow empty string values for these options completely.
2021-12-24 22:30:34 -07:00
Sean Dewar
361f548437
vim-patch:8.2.3671: restarting Insert mode in prompt buffer too often
Problem:    Restarting Insert mode in prompt buffer too often when a callback
            switches windows and comes back. (Sean Dewar)
Solution:   Do not set "restart_edit" when already in Insert mode.
34c20ff85b

As Test_prompt_switch_windows is skipped, implement it in prompt_buffer_spec.

Replace the 50ms term_wait calls with poke_eventloop (test seems to work anyway
without them, so maybe they're not required?)

The new test does include a duplicate screen test that may generate a "screen
test succeeded immediately" warning, but this is done to match the Vim test.
2021-12-07 11:34:28 +00:00
Sean Dewar
0f792b284f
test(prompt_buffer_spec): include changes from v8.1.1984
I already ported v8.1.1984 previously, but hadn't updated prompt_buffer_spec to
match test_prompt_buffer (which we have but due to Vim features such as
term_sendkeys it's mostly skipped).

Required for v8.2.3671.
2021-12-07 11:34:28 +00:00
Sean Dewar
d6258a9bad
vim-patch:8.2.2014: using CTRL-O in a prompt buffer moves cursor to start
Problem:    Using CTRL-O in a prompt buffer moves cursor to start of the line.
Solution:   Do not move the cursor when restarting edit. (closes vim/vim#7330)
ee8b787bcd

Test_prompt_editing is skipped, so edit the Lua test in prompt_buffer_spec.
2021-12-07 11:34:27 +00:00
Sean Dewar
38cd91de5f
vim-patch:8.2.1781: writing to prompt buffer interferes with insert mode
Problem:    Writing to prompt buffer interferes with insert mode.
Solution:   Use win_enter() instead of just setting "curwin". (Ben Jackson,
            closes vim/vim#7035)
4537bcc889

Vim test will be skipped, so add a Lua test.
The problem boils down to the use of aucmd_restbuf in a callback, so just test
that (via nvim_buf_set_lines).
2021-12-07 11:34:27 +00:00
Jan Edmund Lazo
afaad8b54e
Merge pull request #16194 from seandewar/vim-8.1.1925
vim-patch:7.4.1777,8.1.{1925,1995,2011,2012,2013,2166},8.2.{0532,0871,1168,1241,3576}
2021-12-07 01:14:21 -05:00
Jan Edmund Lazo
18d81a6724
Merge pull request #16107 from zeertzjq/vim-8.1.1542
vim-patch:8.1.1542,8.2.3549: an OptionSet autocommand does not get enough info
2021-12-06 22:35:05 -05:00
James McCoy
195aec453a
chore: remove legacy/059_utf8_spell_checking.vim
The legacy test was converted to a new style Vim test in
8b81218300.
2021-11-30 23:00:48 -05:00
Sean Dewar
4efcb72bb7
feat(eval/method): partially port v8.1.1993
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
196b466443

server2client requires +clientserver, which hasn't been ported yet.
The eval.txt docs and test_clientserver.vim tests for server2client already exist, so include those
changes.

test_bufline.vim: Test for setbufline requires v8.1.1189 (which was reverted in #10848).
2021-11-26 18:33:59 +00:00
zeertzjq
d40db0edbd vim-patch:8.1.1542: an OptionSet autocommand does not get enough info
Problem:    An OptionSet autocommand does not get enough info.
Solution:   Add v:option_command, v:option_oldlocal and v:option_oldglobal.
            (Latrice Wilgus, closes vim/vim#4118)
d7c9687947
2021-11-22 15:50:14 +08:00
Jan Edmund Lazo
0d967f0298
Merge pull request #16362 from zeertzjq/vim-8.2.3617
vim-patch:8.2.{3468,3617,3618,3622}: some other CWD related patches
2021-11-21 17:47:09 -05:00
zeertzjq
349b9ce9df vim-patch:8.2.3622: "verbose pwd" shows confusing info
Problem:    "verbose pwd" shows confusing info when :lcd does not change
            directory.
Solution:   Clear last_chdir_reason also when the directory does not change.
            (closes vim/vim#9160)
64be6aa3a5

This only ports the tests, as this is already Nvim's behavior.
2021-11-19 20:07:04 +08:00
zeertzjq
4785cad8ee vim-patch:8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Problem:    ":verbose pwd" does not mention 'autochdir' was applied.
Solution:   Remember the last chdir was done by 'autochdir'.  (issue vim/vim#9142)
0526815c15
2021-11-19 20:07:04 +08:00
zeertzjq
0f58ba10e2 vim-patch:8.2.3468: problem with :cd when editing file in non-existent directory
Problem:    Problem with :cd when editing file in non-existent directory. (Yee
            Cheng Chin)
Solution:   Prepend the current directory to get the full path. (closes vim/vim#8903)
c6376c7984
2021-11-19 20:07:04 +08:00
Shougo Matsushita
2c431943d6 fix: remove unneeded gzip check 2021-11-19 13:45:41 +09:00
Shougo Matsushita
9bcbb7f9d2 fix: shell problem 2021-11-19 13:45:41 +09:00
Shougo Matsushita
cf4af351a6 fix: fix GZIP error 2021-11-19 13:45:41 +09:00
Shougo Matsushita
77c2edcacb fix: remove previous executed directories to execute tests locally 2021-11-19 13:45:40 +09:00
Sean Dewar
59c8a1fd51
feat(eval/method): partially port v8.1.1953
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- index(): requires Blobs from v8.1.0735.
           Note that index() was already added as a method in v8.1.1803;
           this patch only adds a test.

- iconv(): requires v8.1.1136 for test_termcodes.vim.

Nvim deprecated inputdialog(), so it no longer has an eval.txt entry.

Keep the test for hlexists() commented-out, just like previously. (Nvim
always defines the Number group, so it always returns 1 instead)

Cannot include both changes to test_syn_attr.vim as Nvim doesn't support
":hi term=..."; however, both test the same ->hlID() syntax anyway.
2021-10-03 20:06:32 +01:00
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
erw7
4813ad48cd vim-patch:8.1.0027: difficult to make a plugin that feeds a line to a job
Problem:    Difficult to make a plugin that feeds a line to a job.
Solution:   Add the nitial code for the "prompt" buftype.
f273245f64
2020-02-12 15:16:32 +09:00
Hye Sung Jung
14a8b3b98c
doc: fix typos [ci skip] #11787 2020-01-30 22:56:34 -08:00
Jan Edmund Lazo
08c5a874ab
vim-patch:8.1.1143: may pass weird strings to file name expansion
Problem:    May pass weird strings to file name expansion.
Solution:   Check for matching characters.  Disallow control characters.
8f130eda47
2020-01-26 17:38:30 -05:00
Jan Edmund Lazo
ad5049aa60
vim-patch:8.2.0010: test64 is old style
Problem:    Test64 is old style.
Solution:   Convert to new style test. (Yegappan Lakshmanan, closes vim/vim#5363)
f9cb05c147
2019-12-16 19:38:29 -05:00
Matthieu Coudron
3beef8ee1c defaults: set nostartofline
Having the cursor change column can be surprising.

Force startofline in functional and old tests.
Remove the functional breakindent test, as it's a subset of the oldtest one.
2019-12-03 13:31:17 +01:00
Daniel Hahler
4b5e2f7a0b tests: remove some redundant legacy tests #11028
These were turned into new-style Vim tests in cbecae46f.
2019-10-26 12:43:38 -07:00
Daniel Hahler
4bbad54817
tests: fix non-controversial misuse of pending (#11247)
Ref: https://github.com/neovim/neovim/pull/11184
2019-10-18 04:46:30 +02:00
Björn Linse
4987311fb5 tests/ui: remove unnecessary screen:detach()
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.
2019-10-13 22:10:42 +02:00
Björn Linse
a330129a28 tests/ui: cleanup illegitimate usages of "attr_ignore"
"attr_ignore" is an anti-pattern, with snapshot_util()
just include all the highlights already.
2019-10-13 22:10:42 +02:00
Jan Edmund Lazo
b3e56957f8 vim-patch:8.1.0460: assert_fails() message argument #11051
Problem:    assert_fails() does not take a message argument
Solution:   Add the argument.
1307d1c003
2019-09-21 14:03:46 -07:00
Jan Edmund Lazo
8db9e82e3e
vim-patch:8.0.1770: assert functions don't return anything
Problem:    Assert functions don't return anything.
Solution:   Return non-zero when the assertion fails.
65a5464985
2019-09-16 23:42:44 -04:00
Justin M. Keyes
8b06231612 Merge #10869 'vim-patch:8.1.{0309,0362,0365,0515,1946}' 2019-09-05 14:10:32 -07:00
Justin M. Keyes
540360a775
test: is_os() #10933
- Move os_name() up to "global helpers".
- Rename it to is_os().
- Make it depend on uname() instead of a running Nvim instance.
2019-09-04 06:58:04 -07:00
erw7
4f6df65f02 Change test because maparg was changed to also return lnum 2019-09-04 13:40:04 +09:00
Abdelhakeem Osama
450a68b7cc vim-patch:8.1.0888: the a: dict is not immutable as documented (#10819)
Problem:    The a: dict is not immutable as documented.
Solution:   Make the a:dict immutable, add a test. (Ozaki Kiichi, Yasuhiro
            Matsumoto, closes vim/vim#3929)
31b816042f
2019-08-21 20:17:09 +02:00
Daniel Hahler
e134cc9d4a vim-patch:8.0.1738: ":args" output is hard to read
Problem:    ":args" output is hard to read.
Solution:   Make columns with the names if the output is more than one line.
5d69da462f

vim-patch:8.0.1740: warning for signed-unsigned incompatibility

Problem:    Warning for signed-unsigned incompatibility.
Solution:   Change type from "char *" to "char_u *". (John Marriott)
405dadb63e

Removes ported legacy test that was re-added later.
Ref: https://github.com/neovim/neovim/pull/10147#issuecomment-512609513
2019-07-24 06:09:28 +02:00
Jan Edmund Lazo
08aa9b0023 vim-patch:8.1.0211: expanding a file name "~" results in $HOME
Problem:    Expanding a file name "~" results in $HOME. (Aidan Shafran)
Solution:   Change "~" to "./~" before expanding. (closes vim/vim#3072)
00136dc321
2019-05-25 20:36:01 -04:00
Justin M. Keyes
17291642bd test: clear(): args_rm parameter 2019-04-27 16:19:40 +02:00
Jan Edmund Lazo
9d77a07686 vim-patch:8.0.1510: cannot assert beep #9938
Problem:    Cannot test if a command causes a beep.
Solution:   Add assert_beeps().
b48e96f61c
2019-04-25 14:31:33 +02:00
Björn Linse
9452532036 API: don't directly call update_screen() in API functions
There is no need to call update_screen() directly in an API function,
mode input processing invokes update_screen() as needed. And if the API
call is done in a context where redraw is disabled, then redraw is
disabled for a reason. A lot of API functions are of equal semantical
strength (nvim_call_function and nvim_execute_lua can also do whatever,
nvim_command is not special), this inconsistency has no purpose.
2019-01-08 23:31:48 +01:00
James McCoy
bebbf08c8c
vim-patch:8.1.0354: packadd test fails on MS-Windows
Problem:    Packadd test fails on MS-Windows.
Solution:   Ignore difference between forward and backward slashes.
53c8a478cc
2018-12-29 16:53:09 -05:00
James McCoy
ce4199e8b0
vim-patch:8.1.0353: an "after" directory of a package is appended to 'rtp'
Problem:    An "after" directory of a package is appended to 'rtp', which
            will be after the user's "after" directory. ()
Solution:   Insert the package "after" directory before any other "after"
            directory in 'rtp'. (closes vim/vim#3409)
99396d4cbf
2018-12-29 16:52:25 -05:00
James McCoy
91f40ff284
vim-patch:8.0.1734: package directory not added to 'rtp' if prefix matches
Problem:    Package directory not added to 'rtp' if prefix matches.
Solution:   Check the match is a full match. (Ozaki Kiichi, closes vim/vim#2817)
            Also handle different ways of spelling a path.
f98a39ca57
2018-12-29 12:57:16 -05:00
James McCoy
e09fb6ee53
vim-patch:8.0.1469: when package path is a symlink 'runtimepath' is wrong
Problem:    When package path is a symlink adding it to 'runtimepath' happens
            at the end.
Solution:   Do not resolve symlinks before locating the position in
            'runtimepath'. (Ozaki Kiichi, closes vim/vim#2604)
2374faae11
2018-12-29 11:46:21 -05:00
Jan Edmund Lazo
5de5507ea6 vim-patch:8.1.0550: expression evaluation may repeat an error message
Problem:    Expression evaluation may repeat an error message. (Jason
            Franklin)
Solution:   Increment did_emsg and check for the value when giving an error
            for the echo command.
76a6345433
2018-11-30 23:35:36 -05:00
Jan Edmund Lazo
fe2e7cfdee functionaltest: enable FilterReadPre,FilterReadPost test 2018-10-31 22:55:07 -04:00
Jan Edmund Lazo
88974c8e66 functionaltests: win: enable gzip test
Close gzip file handles.
2018-10-31 22:54:18 -04:00
Justin M. Keyes
9642903dea
test: Improve 008_autocommands_spec reliability (#9129)
Sometimes 008_autocommands_spec fails like this:

    [ RUN      ] autocommands that delete and unload buffers: BufUnload, VimLeave: -- Output to stderr:
    CMake Error at /home/travis/build/neovim/neovim/cmake/RunTests.cmake:53 (message):
      functional tests failed with error: 1

The final :quit + wait() is a race. Use command() instead, which is
synchronous.  Use command('silent! ...') everywhere else too, because
it's clearer instead of feeding input and clearing the expected errors
with CTRL-L.
2018-10-17 09:24:45 +02:00
Björn Linse
c8810a51a3 tests: improve robustness of immediate successes in screen tests 2018-10-15 20:13:11 +02:00
Jan Edmund Lazo
2c0998e104 vim-patch:8.0.1291: C indent wrong when * immediately follows comment
Problem:    C indent wrong when * immediately follows comment. (John Bowler)
Solution:   Do not see "/*" after "*" as a comment start. (closes vim/vim#2321)
f8c53d3d26
2018-08-20 00:05:12 -04:00
Jan Edmund Lazo
0bdd4e8393 oldtests: finish port of 8.0.1224 2018-08-15 01:27:30 -04:00
Jan Edmund Lazo
c9f2faf3bf vim-patch:8.0.1398: :packadd does not load packages from the "start" directory (#8762)
Problem:    :packadd does not load packages from the "start" directory.
            (Alejandro Hernandez)
Solution:   Make :packadd look in the "start" directory if those packages were
            not loaded on startup.
9e1d399e63
2018-07-23 02:04:49 +02:00
Justin M. Keyes
b7514493a0
defaults: shortmess+=F (#8619)
Because we default to laststatus=2 (statusline is always visible), the
:edit message is not useful.

ref #6289
2018-06-22 08:18:02 +02:00
Jan Edmund Lazo
7f6c1d256f vim-patch:8.0.0254: error message of assert functions (#8488)
Problem:    When using an assert function one can either specify a message or
            get a message about what failed, not both.
Solution:   Concatenate the error with the message.
c7b831ca15
2018-06-07 09:59:45 +02:00
Jan Edmund Lazo
e21f454e11 fixup: always delete Xfile, fix exit code check
after_each + os.remove ensures Xfile is deleted after every test.
Windows exit code is inconsistent.
2018-05-25 07:43:02 -04:00
Jan Edmund Lazo
51db8ebf67 win: test: delete sautest/ 2018-05-24 22:11:15 -04:00
Jan Edmund Lazo
64177e3e98 win: test: don't test symlink if not admin user 2018-05-24 22:11:14 -04:00
Jan Edmund Lazo
209f05b487 win: test: disable non-admin failing tests
mkfifo (msysgit) does not work outside of msys2 environment.
gzip tests fail on Windows.

mklink requires admin privs for file symbolic links so mklink fails.
2018-05-24 22:11:12 -04:00
Justin M. Keyes
c9f3174075 API: return non-generic VimL errors
- Return VimL errors instead of generic errors for:
  - nvim_call_function
  - nvim_call_dict_function
- Fix tests which were silently broken before this change.

This violates #6150 where we agreed not to translate API errors.  But
that can be fixed later.
2018-05-09 23:18:38 +02:00
b-r-o-c-k
ab6051331c build/msvc: Fix check for cksum on Windows 2018-03-26 10:54:44 -05:00
Jan Edmund Lazo
df99ab461e test: enable legacy/fixeol_spec in Windows
Try nvim's delete() for cross-platform file remove in Windows
2018-02-19 07:10:45 -05:00
Jan Edmund Lazo
6beb7ee77a win: enable legacy test 051 2018-02-19 07:10:44 -05:00
Jan Edmund Lazo
f1e6828b7b win: enable legacy test 059 2018-02-19 07:10:44 -05:00
Jan Edmund Lazo
2943056f75 win: enable legacy test 107 2018-02-19 07:10:44 -05:00
Jan Edmund Lazo
44dc8b4753 win: enable legacy test 093 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
10fbae086a win: enable legacy/arglist_spec.lua 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
18a53b6502 win: enable legacy test 30 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
c5a7f451ce win: enable legacy/getcwd_spec.lua 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
3c0cc9c2fb win: enable legacy/wordcount_spec.lua 2018-02-19 07:10:43 -05:00
Jan Edmund Lazo
e55de56a99 win: enable legacy/packadd_spec.lua 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
f4d82c1438 win: enable legacy test 011 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
4f65cd7c0a win: enable legacy/delete_spec.lua 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
bde32edefe win: enable legacy test 097 2018-02-19 07:10:42 -05:00
Jan Edmund Lazo
0fd899aa07 win: enable legacy test 025 2018-02-19 07:10:41 -05:00
Justin M. Keyes
9bf9cc69c1 test/arglist_spec: update to Vim 8.0.0721 behavior 2018-02-11 19:03:28 +01:00
Justin M. Keyes
4b7f7be301 test: port Test_edit_08() to Lua test
Test_edit_08() depends on special-case handling in has_compl_option()
and redrawing() which are in Vim but are not wanted in Nvim. Using a Lua
test instead of depending on workarounds in the core to make the VimL
test work.
2018-02-11 19:03:27 +01:00
Justin M. Keyes
7d12597d29 vim-patch:8.0.0692: CTRL-G with 'incsearch' and ? goes in the wrong direction
Problem:    Using CTRL-G with 'incsearch' and ? goes in the wrong direction.
            (Ramel Eshed)
Solution:   Adjust search_start. (Christian Brabandt)

da5116da45
2018-02-11 15:27:56 +01:00
Justin M. Keyes
f8010ea3ec
test: robust cleanup, unique filenames #7950 (#7950)
Use unique filenames to avoid test conflicts.
Use read_file() instead of io.popen(), to ensures the file is closed.
Use helpers.rmdir(), it is far more robust than lfs.

closes #7911
2018-02-01 03:12:37 +01:00
KunMing Xie
649123d07c vim-patch:8.0.0358,8.0.0359 (#7832)
vim-patch:8.0.0358: invalid memory access in C-indent code
Problem:    Invalid memory access in C-indent code.
Solution:   Don't go over end of empty line. (Dominique Pelle, closes vim/vim#1492)
60629d6425

vim-patch:8.0.0359: 'number' and 'relativenumber' are not properly tested
Problem:    'number' and 'relativenumber' are not properly tested.
Solution:   Add tests, change old style to new style tests. (Ozaki Kiichi,
            closes vim/vim#1447)
dc9a081712
2018-01-30 21:21:29 +01:00
KunMing Xie
2a1a624878 vim-patch:8.0.0443: terminal width is set to 80 in test3 (#7933)
Problem:    Terminal width is set to 80 in test3.
Solution:   Instead of setting 'columns' set 'wrapmargin' depending on
            'columns.

38a3d6c960
2018-01-30 20:15:05 +01:00
Jan Edmund Lazo
0578087e5e test: osx: try resolve($TMPDIR) 2018-01-28 13:58:56 -05:00
Jan Edmund Lazo
5c09f37d4a test: fix failed tests with $TMPDIR in QuickBuild 2018-01-28 13:58:56 -05:00
Jan Edmund Lazo
7ac21332cf Revert "test: fix failed test cases with tmpdir = $TMPDIR"
This reverts commit f7fe3012204169f22412194a78f196ffc72bb8c3.

Fails on QuickBuild because it uses a non-local path.
Need a environment-agnostic solution
2018-01-28 13:58:56 -05:00
Jan Edmund Lazo
28236867a0 test: fix failed test cases with tmpdir = $TMPDIR 2018-01-28 13:58:55 -05:00
Jan Edmund Lazo
c08c09add7 test: try $TMPDIR for temporary directory 2018-01-28 13:58:55 -05:00
Jan Edmund Lazo
984a93df96 win: enable legacy/fnamemodify_spec.lua 2018-01-28 13:58:54 -05:00
ckelsel
b00fd49640 vim-patch:8.0.0423: changing 'cinoptions' does not always work
Problem:    The effect of adding "vim/vim#" to 'cinoptions' is not always removed.
            (David Briscoe)
Solution:   Reset b_ind_hash_comment. (Christian Brabandt, closes vim/vim#1475)

6b64394f34
2018-01-20 15:48:23 +08:00
ZyX
ceb45a0885 *: Fix test failures 2017-12-11 01:43:36 +03:00
ckelsel
c0e45d97b0 vim-patch:8.0.0148 #7344
Problem:    When a C preprocessor statement has two line continuations the
            following line does not have the right indent. (Ken Takata)
Solution:   Add the indent of the previous continuation line. (Hirohito
            Higashi)

c6aa475a27
2017-10-07 17:10:37 +02:00
KillTheMule
126b2ca077 test: lint whitespace in legacy/ (#7308) 2017-09-24 20:42:48 +02:00
KunMing Xie
ceade2fe53 vim-patch:8.0.0186 (#7154)
Problem:    The error message from assert_notequal() is confusing.
Solution:   Only mention the expected value.

5869cf060e
2017-09-10 12:52:43 +02:00
James McCoy
46a4099dfb Merge pull request #7192 from llorens/vim-8.0.0092
vim-patch:8.0.0092
2017-08-25 11:21:36 -04:00
Justin M. Keyes
7f7698649f Merge #6973 from teto/normal_hl 2017-08-22 20:01:50 +02:00
Matthieu Coudron
4d91369fd7 syntax.c: register 'Normal' highlight group
- :hi Normal works with -u NONE
- Makes HL_TABLE and ATTR_ENTYRY a function instead of a macro so that in can be used in gdb.
- Introduces ATTRENTRY_INIT to init attrentry_t
2017-08-22 12:37:59 +02:00
James McCoy
fc7bf1c71d
vim-patch:8.0.0437
Problem:    The packadd test does not create the symlink correctly and does
            not test the right thing.
Solution:   Create the directory and symlink correctly.

644df41c44
2017-08-21 20:29:49 -04:00
James McCoy
651c6f9b6e
vim-patch:8.0.0326
Problem:    Packadd test uses wrong directory name.
Solution:   Use the variable name value. (Hirohito Higashi)

24f8f543d4
2017-08-21 20:29:49 -04:00
James McCoy
24a5564196
vim-patch:8.0.0325
Problem:    Packadd test does not clean up symlink.
Solution:   Delete the link. (Hirohito Higashi)

913727e567
2017-08-21 20:29:48 -04:00
James McCoy
a66eca78c2
vim-patch:8.0.0308
Problem:    When using a symbolic link, the package path will not be inserted
            at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi)
Solution:   Resolve symbolic links when finding the right position in
            'runtimepath'. (Hirohito Higashi)

2f9e575583
2017-08-21 20:29:48 -04:00
Lech Lorens
d2595ba1c4 vim-patch:8.0.0092
Problem:    C indenting does not support nested namespaces that C++ 17 has.
Solution:   Add check that passes double colon inside a name. (Pauli, closes
            vim/vim#1214)

ca8b8d6956
2017-08-21 23:00:51 +02:00
ckelsel
5cd68b3900 vim-patch:8.0.0124 #7092
Problem:    Internal error for assert_inrange(1, 1).
Solution:   Adjust number of allowed arguments. (Dominique Pelle)

3421566376
2017-07-30 14:15:26 +02:00
James McCoy
54d5e90a2b
vim-patch:7.4.2320
Problem:    Redraw problem when using 'incsearch'.
Solution:   Save the current view when deleting characters. (Christian
            Brabandt) Fix that the '" mark is set in the wrong position. Don't
            change the search start when using BS.

dda933d06c
2017-06-26 22:08:13 -04:00
James McCoy
0dd6455659
vim-patch:7.4.2268
Problem:    Using CTRL-N and CTRL-P for incsearch shadows completion keys.
Solution:   Use CTRL-T and CTRL-G instead.

1195669f9e
2017-06-26 22:08:11 -04:00
James McCoy
518b42db91
functests/legacy: Add lua version of test_search.vim 2017-06-26 22:07:28 -04:00
James McCoy
d707b2a171
vim-patch:8.0.0478
Problem:    Tests use assert_true(0) and assert_false(1) to report errors.
Solution:   Use assert_report().

37175409d7
2017-06-06 06:15:16 -04:00
AdnoC
5908f562df test: Fix and add cases for unnamed register
Also:

Add ru to shada tests with all keys

Add test for unset unnamed and register 0
2017-05-31 13:31:05 -04:00
AdnoC
beca4dc16c eval/shada: Add testing for unnamed register with setreg and startup 2017-05-31 13:19:08 -04:00
James McCoy
901c8fbcdb regexp_nfa: Fix invalid fallthrough in character class detection
When the end character in a range matches a different standard range
(e.g., [0-z]), the range would be incorrectly detected as the class of
the end character (CLASS_az).

Instead of using a fallthrough, immediately FAIL when the end character
doesn't match the expected range.
2017-05-12 17:07:25 -04:00
ZyX
f5be643205 functests: Fix linter errors 2017-04-09 03:31:13 +03:00
ZyX
444cab3731 functests: Fix legacy/wordcount_spec
Another test where bug was hidden by execute().
2017-04-09 03:24:21 +03:00
ZyX
bd84bf8c81 functests: Fix legacy/eval_spec 2017-04-09 03:24:20 +03:00
ZyX
e170186a8d functests: Fix legacy/close_count_spec 2017-04-09 03:24:20 +03:00
ZyX
bc98c37532 functests: Fix legacy/autocmd_option_spec 2017-04-09 03:24:19 +03:00
ZyX
a3b0146fb7 functests: Fix legacy/arglist_spec 2017-04-09 03:24:19 +03:00
ZyX
2824eb7774 functests: Fix legacy/107_adjust_window_and_contents_spec 2017-04-09 03:24:18 +03:00
ZyX
5fd8f637af functests: Fix legacy/097_glob_path_spec 2017-04-09 03:24:18 +03:00
ZyX
9a0c921909 functests: Fix legacy/096_location_list_spec 2017-04-09 03:24:17 +03:00
ZyX
d53fae5f54 functests: Fix legacy/067_augroup_exists_spec 2017-04-09 03:24:15 +03:00
ZyX
c35bd4d074 functests: Fix legacy/074_global_var_in_viminfo_spec 2017-04-09 03:24:13 +03:00