Commit Graph

29399 Commits

Author SHA1 Message Date
Daniel Hahler 8fda095b6d tests: fix/improve "jobwait returns -1 when timed out" #10767
There was a longer timeout for Windows already, but unlike stated in
51d42917f it is not a worst-case, but gets waited for always.

The test is only about "-1" on timeout, so reduce it to this.

Fixes:

    16:33:19,309 INFO  - not ok 627 - jobs jobwait with timeout argument will return -1 if the wait timed out
    16:33:19,309 INFO  - # test/functional/core/job_spec.lua @ 707
    16:33:19,309 INFO  - # Failure message: test/functional/core/job_spec.lua:714: Expected objects to be the same.
    16:33:19,309 INFO  - # Passed in:
    16:33:19,309 INFO  - # (table: 0x0db1a3f0) {
    16:33:19,309 INFO  - #   [1] = 'notification'
    16:33:19,309 INFO  - #   [2] = 'wait'
    16:33:19,309 INFO  - #  *[3] = {
    16:33:19,309 INFO  - #    *[1] = {
    16:33:19,309 INFO  - #      *[1] = -1
    16:33:19,309 INFO  - #       [2] = -1 } } }
    16:33:19,309 INFO  - # Expected:
    16:33:19,309 INFO  - # (table: 0x0db1a480) {
    16:33:19,309 INFO  - #   [1] = 'notification'
    16:33:19,309 INFO  - #   [2] = 'wait'
    16:33:19,309 INFO  - #  *[3] = {
    16:33:19,309 INFO  - #    *[1] = {
    16:33:19,309 INFO  - #      *[1] = 4
    16:33:19,309 INFO  - #       [2] = -1 } } }
    16:33:19,309 INFO  - # stack traceback:
    16:33:19,309 INFO  - # 	test/functional/core/job_spec.lua:714: in function <test/functional/core/job_spec.lua:707>
2019-08-14 09:08:25 +02:00
Daniel Hahler 7668f04392 tests: include `timer_start` in duration #10772
This should not make much of a difference, but increases the timeout
when `load_factor` is used slightly.
2019-08-14 08:59:06 +02:00
mg979 a690bf8116 mksession: use exists(':tcd'), not has('nvim') #10770
Since recent vim versions also support :tcd, check for the actual
availability of the command, rather than has('nvim').
2019-08-14 08:45:54 +02:00
Daniel Hahler c285ebfa73
vim-patch:8.1.0456: running test hangs when the input file is being edited (#10764)
Problem:    Running test hangs when the input file is being edited.
Solution:   Use a SwapExists autocommand to ignore editing the test script.
d8f27b30d6
2019-08-14 01:56:59 +02:00
Daniel Hahler f2377e3575
tests: use larger timeout with "timers can be stopped from the handler" (#10760)
Seen on quickbuild:

    23:01:01,289 INFO  - not ok 1172 - timers can be stopped from the handler
    23:01:01,289 INFO  - # test/functional/eval/timer_spec.lua @ 154
    23:01:01,289 INFO  - # Failure message: test/functional/eval/timer_spec.lua:166: Expected objects to be the same.
    23:01:01,289 INFO  - # Passed in:
    23:01:01,289 INFO  - # (number) 3
    23:01:01,289 INFO  - # Expected:
    23:01:01,289 INFO  - # (number) 0
    23:01:01,289 INFO  - # stack traceback:
    23:01:01,289 INFO  - # 	test/functional/eval/timer_spec.lua:166: in function <test/functional/eval/timer_spec.lua:154>

Log: http://neovim-qb.szakmeister.net/build/24288
Ref: https://github.com/neovim/neovim/pull/10364
2019-08-14 00:44:32 +02:00
Justin M. Keyes 02c52a18f5 style 2019-08-13 22:22:47 +02:00
Justin M. Keyes cbfd18c85a startup: handle 'guicursor' after user config
If parse_shape_opt() is done before user config, the TUI may cause
unwanted changes to the terminal cursor which cannot later be undone
(see #4396).

fix #10750
2019-08-13 22:19:00 +02:00
Daniel Hahler c649e18131
Merge pull request #10752 from blueyed/vim-8.0.1179 2019-08-13 22:16:41 +02:00
Daniel Hahler db41d02e48 vim-patch:8.1.1842: test listed as flaky should no longer be flaky
Problem:    Test listed as flaky should no longer be flaky.
Solution:   Remove Test_popup_and_window_resize from the list of flaky tests.
            (Daniel Hahler, close vim/vim#4807)
9570aacdb8
2019-08-13 22:15:54 +02:00
Daniel Hahler 4e6c596431 vim-patch:8.0.1179: Test_popup_and_window_resize() does not always pass
Problem:    Test_popup_and_window_resize() does not always pass.
Solution:   Do not use $VIMPROG, pass the Vim executable in the vimcmd file.
            (Ozaki Kiichi, closes vim/vim#2186)
631820536e

vim-patch:8.0.1526: no test using a screen dump yet

Problem:    No test using a screen dump yet.
Solution:   Add a test for C syntax highlighting.  Add helper functions.
da65058a9c

NOTE: uses modified `GetVimProg()` (which is used with skipped tests only
(mostly because of `!has('terminal')`)).

Vim uses a 'vimcmd' file, while Nvim uses `$NVIM_TEST_ARGX` environment
variables.

Ref: https://github.com/vim/vim/pull/4806
2019-08-13 22:15:54 +02:00
Ihor Antonov 947bd293c9 clang/"null pointer dereference" #10755 2019-08-13 20:52:25 +02:00
Jan Edmund Lazo 5e1acd412b vim-patch:8.1.1843: might be freeing memory that was not allocated (#10756)
Problem:    Might be freeing memory that was not allocated.
Solution:   Have next_fenc() set the fenc_alloced flag. (closes vim/vim#4804)
f077db2423
2019-08-13 16:46:26 +02:00
Daniel Hahler 90e44ecf11
build: link libraries by full path (for luv.so) (#10661)
Use "luv" as imported library to work around "-lluv" being used due to
missing SONAME.

Fixes https://github.com/neovim/neovim/issues/10407.
Ref: https://gitlab.kitware.com/cmake/cmake/issues/19578
Ref: https://github.com/NixOS/nixpkgs/issues/64400#issuecomment-516557253
2019-08-12 18:22:02 +02:00
Daniel Hahler a336a05e7e
testdir/test_popup.vim: sync/align with Vim (#10751) 2019-08-12 17:10:48 +02:00
Ghjuvan Lacambre 2037028b50 ex_getln.c: fix compute_cmdrow() not resetting lines_left (#10749)
Before this commit, when `inccomand` was set to `nosplit`, multi-line
substitutions collapsed the command-line.

This happened because when ex_getln.c:cursorcmd() computed a msg_row, it
was given a cmdline_row one line too high. This happened because
message.c:msg_puts_display() was supposed to decrement cmdline_row but
didn't, because of the `msg_no_more && lines_left == 0` check placed
just before the decrementation part in msg_puts_display's while loop.

Every time msg_puts_display writes a line, it decreases `lines_left` (a
variable used to know how many lines are left for prompts). Since
redrawcommandline() did not reset `lines_left` between calls to
msg_puts_display, every time a character was pressed, `lines_left` was
decremented. This meant that once the user pressed COLUMNS+ROWS numbers
of characters, `lines_left` would reach 0 and prevent msg_row from being
decremented.

It makes sense to fix setting `lines_left` to `cmdline_row` in
`compute_cmdrow` ; after all, computing where the command line row
should be placed is equivalent to computing how many `lines_left` of
output there are left.

Closes #8254.
2019-08-12 14:21:15 +02:00
Justin M. Keyes ad4eb18e43 Merge #10098 'win: fix msg_puts_printf()' 2019-08-12 02:42:13 +02:00
Justin M. Keyes 71378a4030 free_buffer: rework b:changedtick handling #9163
- Re-enable Test_BufLeave_Wipe. 66f5e5c7d7

This is my (probably-wrong) application of Zyx's suggestion in #9163:

> free_buffer_stuff() already removes changedtick. It is better to
> make `free_options` a flag variable and avoid calling
> buf_init_changedtick() based on some flag there: current workflow
> looks weird as it first removes `b:changedtick`, then re-adds it
> by calling buf_init_changedtick(), then remove again.

> Also based on my understanding it looks logical to not remove
> `b:changedtick`, but to *replace* it with something allocated if
> needed based on examining reference count before calling
> `unref_var_dict`. Because now you have key disappearing from
> dictionary for no good reason.

Patch-By: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
2019-08-12 02:17:49 +02:00
Justin M. Keyes feee862064 vim-patch:8.0.1193: crash when wiping buffer after getbufinfo()
Problem:    Crash when wiping out a buffer after using getbufinfo().
            (Yegappan Lakshmanan)
Solution:   Remove b:changedtick from the buffer variables.

(Note: The test changes in vim-patch:8.0.1193 were already included.)
2019-08-12 02:17:49 +02:00
Daniel Hahler 48dc6344d6
Merge pull request #10745 from blueyed/vim-8.1.1461
vim-patch:8.1.1461 / vim-patch:8.1.1462
2019-08-11 20:35:31 +02:00
Daniel Hahler 6b028ec5f2
ci: AppVeyor: branches: only: master (#10746)
Only build PRs for master, and not other branches on the main repo, e.g.
when reverting via GitHub's UI.
2019-08-11 20:30:27 +02:00
Daniel Hahler ef1c100174 rebuild [skip travis] 2019-08-11 15:36:09 +02:00
erw7 6616d1d3e5 win/env: Vim-compat: Empty string deletes env var #10743
- Windows: `set FOO=` deletes environment variable FOO, and there is no
  way to set empty string expect by calling the API.
- Vim-compatible: `:let $FOO=""` deletes the environment variable.
- See also Test_WindowsHome().

ref: https://github.com/neovim/neovim/pull/10657#issuecomment-516368089
2019-08-11 15:32:07 +02:00
Daniel Hahler 2193e68837 vim-patch:8.1.1462: MS-Windows: using special character requires quoting
Problem:    MS-Windows: using special character requires quoting.
Solution:   Add quotes. (Ken Takata)
c974022c31
2019-08-11 13:24:17 +02:00
Daniel Hahler 143b02c573 vim-patch:8.1.1461: tests do not run or are not reliable on some systems
Problem:    Tests do not run or are not reliable on some systems.
Solution:   Use "findstr" instead of "grep" on MS-Windows. Clear
            PROMPT_COMMAND in the terminal test. Delete temp file. Wait for
            output after executing a debug command. (Yegappan Lakshmanan,
            closes vim/vim#4479)
ddd3308782

Ignored changes to testdir/test_terminal.vim.
2019-08-11 13:23:30 +02:00
Daniel Hahler 0a98765b44 test_source.vim: move Test_source_sandbox 2019-08-11 13:23:30 +02:00
erw7 7d664837e1 win: expand nested env var #10662
Vim-compatible behavior for a Windows edge case.
2019-08-11 09:51:00 +02:00
Ihor Antonov e5d388f23a clang/"Argument with 'nonnull' attribute passed null" #10739
Problem:  In screen.c grid_char_needs_redraw clang warns
          that grid->chars could be NULL

Solution: Suggested by bfredl. Add explicit check
          grid->chars != NULL in grid_put_linebuf
          similar to grid_puts_len
2019-08-11 09:47:49 +02:00
Björn Linse c190415dc2
Merge pull request #10738 from bfredl/cmdwinclose
api/window: disallow closing non-current window in cmdwin state
2019-08-10 21:21:13 +02:00
Justin M. Keyes d8d3719941
Merge #10737 from blueyed/vim-8.1.0911
vim-patch:8.1.0911: tag line with Ex command cannot have extra fields
2019-08-10 18:35:00 +02:00
Björn Linse 67664c74f8 api/window: disallow closing non-current window in cmdwin state 2019-08-10 17:41:31 +02:00
Daniel Hahler ac395411cd testdir/test_taglist.vim: move Test_tagsfile_without_trailing_newline
Align with Vim.  Added in a79c0c8f7.
2019-08-10 17:21:47 +02:00
Daniel Hahler 4109ee8ef4 vim-patch:8.1.0911: tag line with Ex command cannot have extra fields
Problem:    Tag line with Ex command cannot have extra fields.
Solution:   Recognize |;" as the end of the command. (closes vim/vim#2402)
943e9639a9
2019-08-10 17:21:18 +02:00
R. Simon 5f243fc68a API: nvim_win_close: Fix closing cmdline-window #10087 2019-08-10 13:41:35 +02:00
Justin M. Keyes 278c5d452c
win/os_env_exists(): workaround libuv bug #10734
os_env_exists() fails on MSVC build:
    os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN

- Revert 396a3945c4
- HACK: Windows: return TRUE if uv_os_getenv() returns UV_UNKNOWN, until
  libuv bug is fixed: https://github.com/libuv/libuv/issues/2413

ref 396a3945c4 (r34642361)
2019-08-10 11:48:36 +02:00
Justin M. Keyes 0062c65ba8 test/cmdline_spec: adjust "no-op"
(<Cmd>0<cr> is not really a no-op, it moves the cursor.)

Attempt to avoid flaky test:

    test/functional/ui/cmdline_spec.lua @ 830
    Failure message: ./test/functional/ui/screen.lua:579: Row 2 did not match.
    Expected:
    |                         |
    |*{1:~                        }|
    |{3:                         }|
    |:012345678901234567890123|
    |456789^                   |
    Actual:
    |                         |
    |*{3:                         }|
    |:012345678901234567890123|
    |:012345678901234567890123|
    |456789^                   |

    ./test/functional/ui/screen.lua:579: in function '_wait'
    ./test/functional/ui/screen.lua:367: in function 'expect'
    test/functional/ui/cmdline_spec.lua:841: in function <test/functional/ui/cmdline_spec.lua:830>

ref https://github.com/neovim/neovim/pull/10171#issuecomment-520134344
ref #10171
2019-08-10 11:46:26 +02:00
Justin M. Keyes 396a3945c4 test/environ_spec: Windows treats empty as undefined
ref #10657
2019-08-10 01:43:37 +02:00
Jan Edmund Lazo 43a8242cd5 vim-patch:8.1.1458: crash when using gtags #10704
Problem:    Crash when using gtags. (issue vim/vim#4102)
Solution:   Check for negative row or col in screen_puts_len(). (Christian
            Brabandt)
0b4c9eddb5
2019-08-10 00:21:52 +02:00
Daniel Hahler 06d9cc734b exists(): return false for empty env var #10657
Fixes https://github.com/neovim/neovim/issues/3266
close #10657
2019-08-09 23:42:03 +02:00
Justin M. Keyes 5aa97937e7
Merge #10706 from janlazo/vim-8.1.1465
vim-patch:8.1.{1465,1467}
2019-08-09 23:32:23 +02:00
Daniel Hahler e2d6e67bbc
Merge pull request #10171 from blueyed/vim-8.1.1318
vim-patch:8.1.1318: code for text changes is in a "misc" file
2019-08-09 19:25:56 +02:00
Daniel Hahler 939d9053bd
channels: reflect exit due to signals in exit status code (#10573)
Uses `128 + term_signal` in case of exit due to a signal.

Fixes https://github.com/neovim/neovim/issues/10571.
2019-08-09 15:34:06 +02:00
Daniel Hahler fa0c677a63
tests/functional: expect_msg_seq: use load_adjust (#10727)
Regardless of the comment "Big timeout for ASAN/valgrind" it would use
10s by default already.
This changes it to use `load_adjust`, which itself is only computed on
CI now, and outside of any tests - since it has side effects when being
used the first time!

The failure seen on AppVeyor:

    [ RUN      ] jobs can get the pid value using getpid: ERR
    test\functional\helpers.lua:167:
    ==============================================================================
    got 0 messages (ignored 0), expected 1
    stack traceback:
            test\functional\helpers.lua:167: in function 'expect_msg_seq'
            test/functional\core\job_spec.lua:288: in function <test/functional\core\job_spec.lua:281>

Log: https://ci.appveyor.com/project/neovim/neovim/builds/26537324/job/y1io66fbx399q7h6?fullLog=true#L6554
2019-08-09 15:32:38 +02:00
Justin M. Keyes 642e7daed5
Merge #9782 from janlazo/vim-8.1.0199
vim-patch:8.1.{199,200}
2019-08-09 12:00:47 +02:00
Ihor Antonov 3c0d637592 clang/"Null passed as a nonnull parameter" #10718 2019-08-09 11:24:30 +02:00
Justin M. Keyes 8a56bd944a Merge #10708 'remove DYNAMIC_ICONV'
closes #3457
2019-08-09 11:19:37 +02:00
Adrien Fabre 47b7b471fa :terminal : update buffer when switching tabpage #10700
fix #10696
2019-08-09 10:37:08 +02:00
Jan Edmund Lazo a48896c6e7 vim-patch:8.1.1540: cannot build without +eval #10729
Problem:    Cannot build without the +eval feature.
Solution:   Define ex_const if needed.
0abb4273f6
2019-08-09 10:28:15 +02:00
Justin M. Keyes 4bb728dfa0
test: Minimize shada/helpers.lua #10728 2019-08-09 10:23:57 +02:00
Daniel Hahler 480794146f f_spellbadword: set len=0 for non-found word
`len` is used with `list_append_string` later, and should reflect the
length of `word` (i.e. 0 when not setting word / breaking above).

Ref: neovim/neovim#9782 (comment)
2019-08-08 21:40:29 -04:00
Jan Edmund Lazo d1ce15f696 vim-patch:8.1.0200: spellbadword() not tested
Problem:    spellbadword() not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3235)
872e451e8c
2019-08-08 21:31:20 -04:00