Commit Graph

792 Commits

Author SHA1 Message Date
ZyX
0d56118d86 msgpack_rpc: Fix crash in log_server_msg
It appears that used msgpack library is not able to parse back message created 
by msgpack_rpc_from_object() if nesting level is too high, so log_server_msg now 
cares about msgpack_unpack_next() return value. Also error message from 
server_notifications_spec.lua is not readable if something is wrong (though at 
least now it does not crash when parsing deeply nested structures).

log_server_msg() in the test reports

    [msgpack-rpc] nvim -> client(1) [error]        "parse error"
2016-06-24 16:53:26 +03:00
ZyX
90b8cf133e msgpack_rpc: Also make msgpack_from_*/msgpack_to_* functions not recur
This removes some stack overflows in new test regarding deeply nested variables.
Now in place of crashing vim_to_object/msgpack_rpc_from_object/etc it crashes
clear_tv with stack overflow.
2016-06-24 16:53:26 +03:00
ZyX
da15b5c1f3 api/helpers: Use typval_encode.h for vim_to_object
This ought to prevent stack overflow, but I do not see this actually working:
*lua* code crashes with stack overflow when trying to deserialize msgpack from
Neovim, Neovim is fine even if nesting level is increased 100x (though test
becomes very slow); not sure how recursive function may survive this. So it
looks like there are currently only two positive effects:

1. NULL lists are returned as empty (#4596).
2. Functional tests are slightly more fast. Very slightly. Checked for Release
   build for test/functional/eval tests because benchmarking of debug mode is
   not very useful.
2016-06-24 16:53:26 +03:00
Björn Linse
e8a8342132 test: fix command_count_spec
The test hit wait_return if x or .x.swp exists in the project root directory.
2016-06-23 16:54:19 +02:00
James McCoy
cde1d818d0 vim-patch:7.4.1592
Problem:    Quickfix code using memory after being freed. (Dominique Pelle)
Solution:   Detect that the window was closed. (Hirohito Higashi)

0899d69803
2016-06-22 21:10:07 -04:00
Marco Hinz
1a8d9e9d54 Add tests for new feature 2016-06-20 23:10:46 +02:00
Marco Hinz
a05e7a6bca Make existing tests work with new feature 2016-06-20 23:10:41 +02:00
Justin M. Keyes
7df9dd33a1 Merge #4933 from ZyX-I/fix-matchparen-spec
Make matchparen_spec.lua fail if matchparen is not available
2016-06-20 01:30:59 -04:00
Justin M. Keyes
8a4e5b4bc2 Merge #4697 'capture() function'. 2016-06-20 00:55:41 -04:00
Justin M. Keyes
abeb2f020f test/highlight_spec: Test "gui" arg of synIDattr().
Also use less "regular" values for cterm colors.
2016-06-18 13:07:59 -04:00
Rom Grk
86b138b25d synIDattr(): return RRGGBB value for [fg|bg|sp]# #4851
add tests for synIDattr() with [fg|bg|sp]#

add tests for synIDattr and various #RGB colors

synIDattr: test for ui_rgb_attached()

test: fix tests for synIDattr fg/bg/sp
2016-06-18 12:25:11 -04:00
ZyX
2126ec0c5b functests: Fix matchparen_spec.lua 2016-06-17 20:38:03 +03:00
Björn Linse
16424caeda eval: add api_info()
Previously, the api metadata was only accessible frow within nvim as
msgpackparse(systemlist('nvim --api-info'))[0]
2016-06-17 18:47:45 +02:00
James McCoy
0d3ff4b55d vim-patch:7.4.1126
Problem:    Can only get the directory of the current window.
Solution:   Add window and tab arguments to getcwd() and haslocaldir().
            (Thinca, Hirohito Higashi)

c970330676
2016-06-15 18:04:05 -04:00
James McCoy
d45a665b00 test: functional: Remove unnecessary use of clipboard register
menu_spec.lua yanks to the clipboard, but never pastes from it.  This
can leave a child xsel process waiting around for something to paste the
content, causing the test process to hang.

Since the test isn't explicitly trying to exercise the clipboard, simply
use the default register.
2016-06-15 09:54:27 -04:00
James McCoy
bec5fd5809 test: functional: Remove test_bkc_* files after testing 2016-06-15 09:54:22 -04:00
James McCoy
e7ab3e7e59 test: Use clipboard fixture instead of user's clipboard (#4903) 2016-06-11 12:58:57 -04:00
ZyX
6881fcd203 functests: Do not use setup/teardown where before_/after_each is needed
When skipping these test blocks they may error out:

    Error → test/functional/shell/viml_system_spec.lua @ 154
    system() with output containing NULs setup
    ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value)

    stack traceback:
            ./test/functional/helpers.lua:75: in function 'request'
            ./test/functional/helpers.lua:166: in function 'nvim_feed'
            ./test/functional/helpers.lua:195: in function 'feed'
            test/functional/shell/viml_system_spec.lua:14: in function <test/functional/shell/viml_system_spec.lua:13>

    Error → test/functional/shell/viml_system_spec.lua @ 155
    system() with output containing NULs teardown
    ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value)

    stack traceback:
            ./test/functional/helpers.lua:75: in function 'eval'
            test/functional/shell/viml_system_spec.lua:21: in function <test/functional/shell/viml_system_spec.lua:20>
2016-06-10 21:50:50 +03:00
ZyX
ff470bb853 functests: Check logs in lua code
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
2016-06-10 21:50:49 +03:00
Justin M. Keyes
a160590e40 Merge #4813 'runtime: clipboard: start daemons in /'. 2016-06-10 03:05:28 -04:00
James McCoy
56e9e81115 Merge pull request #4738 from brcolow/vim-7.4.1223
vim-patch:7.4.1223
2016-06-09 21:18:29 -04:00
Michael Ennen
b1c9d7d237 vim-patch:7.4.1223
Problem:    Crash when setting v:errors to a number.
Solution:   Free the typval without assuming its type. (Yasuhiro Matsumoto)

a542c680a8
2016-06-09 21:18:09 -04:00
Jurica Bradaric
6c550a4f13 vim-patch:7.4.1468
Problem:    Sort test doesn't test with "1" argument.
Solution:   Also test ignore-case sorting. (Yasuhiro Matsumoto)

51d1d53680
2016-06-09 20:34:43 +02:00
Jurica Bradaric
b2d15fbebc vim-patch:7.4.1464
Problem:    When the argument of sort() is zero or empty it fails.
Solution:   Make zero work as documented. (suggested by Yasuhiro Matsumoto)

5131c144fe
2016-06-09 20:34:43 +02:00
Jurica Bradaric
82da7eed34 vim-patch:7.4.1397
Problem:    Sort test fails on MS-Windows.
Solution:   Correct the compare function.

0bb6108eb4
2016-06-09 20:34:43 +02:00
Jurica Bradaric
81b9b37e01 vim-patch:7.4.1394
Problem:    Can't sort inside a sort function.
Solution:   Use a struct to store the sort parameters. (Jacob Niehus)

0b962473dd
2016-06-09 20:34:43 +02:00
Michael Ennen
06bbb79e63 vim-patch:7.4.1153
Problem:    Autocommands triggered by quickfix cannot always get the current
            title value.
Solution:   Call qf_fill_buffer() later. (Christian Brabandt)

6920c72d4d

Helped by @mhinz
2016-06-09 11:12:51 +02:00
Lucas Hoffmann
38d98bba68 tests: Migrate legacy test 34. (#2849) 2016-06-08 00:25:53 -04:00
James McCoy
15afd30e04 test: Fix path to valgrind suppressions (#4892) 2016-06-08 00:24:23 -04:00
Aleksa Sarai
1bb8930c92 test: add tests for cwd handling
Add both a test for cwd=/ and cwd=/tmp/nvim.XXXXX, to make sure that we
don't have regressions in cwd handling.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-06-07 17:26:49 +10:00
Justin M. Keyes
234346312e test: expand_spec: clean up fixtures 2016-06-06 11:04:09 -04:00
Justin M. Keyes
5f5f2d8945 test: rmdir(): recursively delete 2016-06-06 11:04:09 -04:00
KillTheMule
999590b313 Testlint. (#4881) 2016-06-05 08:26:47 -04:00
Justin M. Keyes
d97a97d7e8 Merge pull request #4879 from justinmk/test55
tests: Migrate legacy test 55
2016-06-05 04:42:46 -04:00
KillTheMule
5a387dddc6 Fix indents. 2016-06-05 04:26:33 -04:00
KillTheMule
dfaf720442 Testlinting. 2016-06-05 04:26:18 -04:00
Justin M. Keyes
c156a18280 Merge pull request #2844 from lucc/test10
tests: migrate legacy test 10
2016-06-05 04:22:52 -04:00
Justin M. Keyes
02e6914a93 Merge pull request #4860 from jamessan/tab-win-precedence
tcd: Determine correct scope from user input
2016-06-04 11:05:05 -04:00
James McCoy
667c1dc4de vim-patch:7.4.1108 (#4872)
Problem:    Expanding "~" halfway a file name.
Solution:   Handle the file name as one name. (Marco Hinz)  Add a test.
            Closes vim/vim#564.

58adb14739
2016-06-03 23:18:40 -04:00
James McCoy
a3f11ad27a test/functional: cd_spec: Add tests for {getcwd,haslocaldir}(-1, -1) 2016-06-01 06:48:41 -04:00
James McCoy
a1303c2e11 test/functional: cd_spec: Add tests for using explicit args 2016-06-01 06:48:41 -04:00
James McCoy
197f384891 test/functional: cd_spec: Use named keys for directories table
The directories table contains the names of the expected directory names
for varying scopes of the :cd tests.  Using named indexes, instead of
numbered, makes the test more readable.
2016-06-01 06:48:41 -04:00
James McCoy
690970acff test/functional: Allow arbitrary arguments to cwd/lwd functions
Build wcwd/tcwd and wlwd/tlwd on top of the reworked cwd/lwd functions.
This will allow for easier testing of `getcwd()`/`haslocaldir()` in
arbitrary windows and/or tab pages.
2016-06-01 06:48:41 -04:00
Justin M. Keyes
1e70ebe849 Merge pull request #4756 from jbradaric/vim-7.4.1119
vim-patch:7.4.1119,7.4.1123,7.4.1132,7.4.1161
2016-05-29 00:03:54 -04:00
Justin M. Keyes
48e945e588 Merge pull request #2825 from lucc/legacy/listlbr
tests: Migrate legacy test listlbr.
2016-05-27 21:06:09 -04:00
ZyX
5758432be2 eval: Stop executing *eval() function at error
Fixes #4822
Closes #4823
2016-05-27 15:11:53 +03:00
Shougo Matsushita
41c0dfd545 Port capture() function
https://groups.google.com/forum/#!msg/vim_dev/H3Z3ChSUh_4/beZs6KzYdBsJ
2016-05-27 10:33:44 +09:00
James McCoy
ccef5c9c77 vim-patch:7.4.1567
Problem:    Crash in assert_fails().
Solution:   Check for NULL. (Dominique Pelle)  Add a test.

1abb502635
2016-05-25 21:02:52 -04:00
Björn Linse
c74ce334f2 Merge pull request #4624 from bfredl/timers
implement timers and process events during sleep
2016-05-25 11:00:54 +02:00
James McCoy
4a40231317 vim-patch:7.4.1071
Problem:    New style tests are executed in arbitrary order.
Solution:   Sort the test function names. (Hirohito Higashi)
            Fix the quickfix test that depended on the order.

cfc0a350a9
2016-05-24 20:49:19 -04:00