Commit Graph

1360 Commits

Author SHA1 Message Date
Matthew Malcomson
9abef7ded9 test/put_spec: 2x speedup (#6294)
Instead of helpers.clear() between each test, use execute('enew!')
and ensure the state that matters is reset between each test.
2017-03-18 01:59:51 +01:00
Jack Bracewell
2ea7bfc627 terminal: Support extra arguments in 'shell'. #4504
Tokenize p_sh if used as default in ex_terminal(). Previously p_sh was
used as the first arg in a list when calling termopen(), this would try
to call an untokenized version of shell, meaning if you had an argument
in 'shell':
    set shell=/bin/bash\ --login
the command would fail.

Helped-by: oni-link <knil.ino@gmail.com>

Closes #3999
2017-03-17 17:47:33 +01:00
Justin M. Keyes
0c1f783164 Merge #6087 from justinmk/defaults
defaults: 'ruler', 'showcmd', 'belloff=all'
2017-03-17 13:00:19 +01:00
Matthew Malcomson
f6946c68ae job-control: set CLOEXEC on pty processes. #5986
Before this change, new processes started with libuv prevented SIGHUP
from reaching pty processes (by keeping the ptmx file descriptor open).
2017-03-17 12:20:51 +01:00
John Szakmeister
694edc5504 test: fix the unit test build on macOS Sierra (#6300)
We need to add the SDK includes to the preprocessing step, otherwise it
will fail to resolve the system includes such as sys/stat.h and fcntl.h.
2017-03-17 09:14:56 +01:00
Justin M. Keyes
a90beeadbb defaults: 'showcmd', 'belloff', 'ruler'
- Vim "unix default" of 'noshowcmd' is serving few users. And it's
  inconsistent.
- 'ruler' and 'belloff=all' improve the out-of-the-box experience.
- Continue to use 'noshowcmd' and 'noruler' by default in the functional
  tests to keep them fast.

TODO: Add a "disable slow stuff" command or mapping to address the
use-case of a very slow terminal connection.
2017-03-16 18:44:10 +01:00
John Szakmeister
3c8d974f73 unittests: avoid using pattern matching on file names
The directory name could contain special characters that trips up the
matching used by find.  Instead, let's just make sure that the filename
starts with the directory name.
2017-03-16 06:58:15 -04:00
Justin M. Keyes
40cc49c5da test/termclose: Avoid indeterminism (#6281) 2017-03-15 23:28:37 +01:00
Björn Linse
9500ecdda5 api: add detailed checks for compatibility and correct "since" value 2017-03-15 15:01:06 +01:00
Björn Linse
82f55503dd api: add api_level_1 fixure 2017-03-15 15:01:06 +01:00
Justin M. Keyes
ec4e84210b Merge #6254 'vim-patch:7.4.2135,7.4.2144,7.4.2151' 2017-03-15 14:10:56 +01:00
Justin M. Keyes
c5e61b41a5 DirChanged: avoid redundant events on 'autochdir' 2017-03-12 15:45:50 +01:00
Justin M. Keyes
d9fcbc2cfb DirChanged: trigger when switching scopes
Closes #6054
2017-03-12 14:39:32 +01:00
Justin M. Keyes
99a1a58c66 DirChanged: Publish _after_ updating win/tab CWD.
So getcwd() works correctly during DirChanged event.

Closes #6260
2017-03-12 14:39:32 +01:00
ZyX
48e7a83447 unittests: Fix linter error 2017-03-12 04:20:31 +03:00
ZyX
def52ad668 tests: Add description of test directory structure and test env vars 2017-03-12 04:18:15 +03:00
ZyX
d559fe6e93 unittests: Allow running ffi.cdef in the main process 2017-03-12 03:14:34 +03:00
ZyX
a7f64ba517 unittests: Move filtering cdefs to main process 2017-03-12 03:02:14 +03:00
ZyX
bf68907778 unittests: Use more adequate names for some functions 2017-03-12 02:54:23 +03:00
ZyX
9d1b439fb7 tests: Allow lfs.attributes to be NULL when traversing FS 2017-03-12 00:25:55 +03:00
ZyX
8ef6cfa6ac unittests: Fix linter errors 2017-03-11 23:48:16 +03:00
ZyX
a54be846cf unittests: Update test/unit/message_spec.lua 2017-03-11 23:26:33 +03:00
ZyX
ec730daee9 unittests: Do not use which, add data to paths.lua.in instead 2017-03-11 23:23:50 +03:00
ZyX
ce12bda712 unittests: Always close all pipes 2017-03-11 23:23:49 +03:00
ZyX
e2a578f40d unittests: Do not import libnvim or headers in main process
Slows down unit tests much, but gets rid of as much preserved state as possible.
2017-03-11 23:23:49 +03:00
ZyX
9400466282 unittests: Check core dumps in after_each, like in functests 2017-03-11 23:23:49 +03:00
ZyX
12b062b2c8 unittests: Run all unit tests in their own processes
Used

    sed -r -i -e '/ helpers =/ s/$/\nlocal itp = helpers.gen_itp(it)/; s/^(\s*)it\(/\1itp(/' test/unit/**/*_spec.lua

to alter all tests. Locally they all run fine now.

Reasoning:

1. General: state from one test should not affect other tests.
2. Local: travis build is failing with something which may be an output of
   garbage collector. This should prevent state of the garbage collector from
   interferring as well.
2017-03-11 23:23:30 +03:00
ZyX
5898b42d82 unittests: Do not run failing test at all 2017-03-11 23:23:30 +03:00
ZyX
29ed5b3a39 unittests: Fix lint errors 2017-03-11 23:23:30 +03:00
ZyX
b442574862 unittests: Allow failing test to fail 2017-03-11 23:23:30 +03:00
ZyX
ff5dca6630 unittests: Log syscalls if requested 2017-03-11 23:23:30 +03:00
ZyX
1edb3ccc36 unittests: Use own bindings to libc syscall wrappers 2017-03-11 23:23:30 +03:00
ZyX
3adecd3ede unittests: Do not use syscall library: does not work well with cimport 2017-03-11 23:23:30 +03:00
ZyX
9f29a76cab unittests: Try using syscall library instead (ffi-based) 2017-03-11 23:23:30 +03:00
ZyX
b92d6aaf0d unittests: Pause garbage collector while executing tests
Temporary (?) workaround for currently failing check_alloc_log tests.
2017-03-11 23:23:30 +03:00
ZyX
82e5af85c1 unittests: Run tests in a separate process 2017-03-11 23:23:30 +03:00
Justin M. Keyes
fd27d5a70f test/scrollback: wiggle-room (#6256) 2017-03-11 14:46:35 +01:00
Justin M. Keyes
d1afd434f3 rplugin: Call s:LoadRemotePlugins() on startup.
Dispense with the FuncUndefined/CmdUndefined quasi-optimization.
If there are no rplugins, plugin/rplugin.vim takes less than 1ms.

Closes #5821
Closes #6250

Helped-by: Qiming zhao <chemzqm@gmail.com>
2017-03-11 12:26:22 +01:00
lonerover
3de3340132 vim-patch:7.4.2135
Problem:    Various tiny issues.
Solution:   Update comments, white space, etc.

89eaa4185e
2017-03-11 18:26:03 +08:00
Justin M. Keyes
087acd79f8 test/let_spec: self-referencing List. (#6228)
Regression test coverage for #6070.
2017-03-08 03:23:40 +01:00
James McCoy
f613dd016a Merge pull request #6225 from jamessan/vim-7.4.2051
vim-patch:7.4.2051,7.4.2068,7.4.2097
2017-03-07 09:03:52 -05:00
Matthew Malcomson
6fe677c108 api: nvim_buf_set_lines(): Avoid invalid ml_get. #6019
When the buffer that nvim_buf_set_lines() is changing is not in any vim
window, fix_cursor() leads to calling ml_get_buf() with an invalid line
number. The condition that fix_cursor() was called on was (buf ==
curbuf), but this is always true because of the call to
switch_to_win_for_buf() earlier in the function.

Instead this should be predicated on (save_curbuf.br_buf == NULL)
2017-03-07 01:29:08 +01:00
James McCoy
4e3a2784ec vim-patch:7.4.2068
Problem:    Not all arguments of trunc_string() are tested.  Memory access
            error when running the message tests.
Solution:   Add another test case. (Yegappan Lakshmanan)  Make it easy to run
            unittests with valgrind.  Fix the access error.

b9644433d2
2017-03-06 15:36:09 -05:00
James McCoy
7217360e34 vim-patch:7.4.2051
Problem:    No proper testing of trunc_string().
Solution:   Add a unittest for message.c.

502ae4ba63
2017-03-06 15:09:40 -05:00
Justin M. Keyes
d1d35c9cfc test: backtick expansion #6218 2017-03-06 12:40:22 +01:00
oni-link
3030ef825d terminal.c: Reset cursor postion when using termopen() (#6212)
After using 'termopen("echo") the current buffer content is changed,
but the cursor position of the current window is not updated.
Because of this, a call to 'mb_adjust_cursor()'  can lead to a
heap-buffer-overflow.

Fix this by resetting the cursor for the current window.

Fixes #3161
2017-03-04 20:12:57 +01:00
Matthew Malcomson
b1731fe1b5 vim-patch:8.0.0388
Fix a problem when filtering manually folded lines

When foldMarkAdjustRecurse() is called to adjust folds that start inside
the range of lines that are being moved and end outside that range, it
calculates `amount_after` for its recursive call incorrectly.
The calculation assumes that folds inside the changed range are being
deleted, but this is not always the case.

This means nested folds that start after the changed range of lines are
shifted an incorrect amount.

We fix this by calculating the `amount_after` differently if the folds
inside the changed range are not being deleted.
2017-03-02 00:18:00 +01:00
Justin M. Keyes
4306e5ae0c test: luacheck update
We pull luacheck HEAD, so this is a "catch up" commit to fix
newly-discovered errors.
2017-03-01 14:47:49 +01:00
Justin M. Keyes
937e54f865 terminal: Keep cursor position.
Let the terminal dictate the normal-mode cursor position. This will be
disorienting sometimes, but it is closer to what users expect vs always
going to the last line.
2017-03-01 14:47:49 +01:00
Justin M. Keyes
2872e57af2 Merge #6191 from jamessan/vim-42ebd06
vim-patch:42ebd06,7.4.2098,6f1d9a0,7.4.2095
2017-02-28 09:57:46 +01:00