aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval
Commit message (Collapse)AuthorAge
* os/shell: Throttle :! output, pulse "..." message.Justin M. Keyes2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly improves responsiveness when :! spams MB or GB of output: :!yes :!while true; do date; done :!git grep '' :grep -r '' * After ~10KB of data is seen from a single :! invocation, output will be skipped for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the behavior alternates at every: * 10KB received * ~1s throttled This also avoids out-of-memory which could happen with large :! outputs. Note: This commit does not change the behavior of execute(':!foo'). execute(':!foo') returns the string ':!foo^M', it captures *only* Vim messages, *not* shell command output. Vim behaves the same way. Use system('foo') for capturing shell command output. Closes #1234 Helped-by: oni-link <knil.ino@gmail.com>
* build: Target luacheck HEAD.Justin M. Keyes2016-11-17
| | | | | | | | | | | | https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606 > If you really want to use bleeding-edge version you should get the > rockspec from master branch, not a fixed commit ... > The correct way to install from a specific commit is cloning that > commit and running "luarocks make" from project directory. The reason > is that running "install" or "build" on an scm rockspec fetches > sources from master but uses build description from the rockspec > itself, which may be outdated.
* Bump all nvim-specific error codes above E5000James McCoy2016-11-15
| | | | | | | | | | In order to not conflict with new error codes that Vim adds, all Neovim error codes should be above 5000. The three existing sub-5000 error codes (E926, E951, and E952) are now E50003, E5004, and E5005 respectively. E953 was removed in 6167ce6df2753d5474ad49aea19f5957128ab015, so just remove it from the help.
* encoding: update testsBjörn Linse2016-11-05
| | | | | | | Change shada reencoding tests to check for correct handling of UTF-8 and binary strings. Delete enc=latin1 json tests.
* api: api_info()['version']Justin M. Keyes2016-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | API level is disconnected from NVIM version. The API metadata holds the current API level, and the lowest backwards-compatible level supported by this instance. Release 0.1.6 is the first release that reports the Nvim version and API level. metadata['version'] = { major: 0, minor: 1, patch: 6, api_level: 1, api_compatible: 0, api_prerelease: false, } The API level may remain unchanged across Nvim releases if the API has not changed. When changing the API, - set NVIM_API_PRERELEASE to true - increment NVIM_API_LEVEL (at most once per Nvim version) - adjust NVIM_API_LEVEL_COMPAT if backwards-compatibility was broken api_level_0.mpack was generated from Nvim 0.1.5 with: nvim --api-info
* api: Nvim version, API level #5386Rui Abreu Ferreira2016-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API level is disconnected from the NVIM version. The API metadata holds the current API level, and the lowest backwards-compatible level supported by this instance. Release 0.1.6 will be the first release reporting the Nvim version and API level. metadata['version'] = { major: 0, minor: 1, patch: 6, prerelease: true, api_level: 1, api_compatible: 0, } The API level may remain unchanged across Neovim releases if the API has not changed. When changing the API the CMake variable NVIM_API_PRERELEASE is set to true, and NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented accordingly. The functional tests check the API table against fixtures of past versions of Neovim. It compares all the functions in the old table with the new one, it does ignore some metadata attributes that do not alter the function signature or were removed since 0.1.5. Currently the only fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
* modeline: Handle version number overflow. #5450Florian Larysch2016-10-26
| | | | | | | | | | | Closes #5449 A file containing the string "vim" followed by a very large number in a modeline location will trigger an overflow in getdigits() which is called by chk_modeline() when trying to parse the version number. Add getdigits_safe(), which does not assert overflows, but reports them to the caller.
* version: Allow has("nvim-x"), has("nvim-x.y")Justin M. Keyes2016-10-25
|
* version: has("nvim-1.2.3")Justin M. Keyes2016-10-25
| | | | Helped-by: Daniel Hahler <git@thequod.de>
* test: system(): Avoid indeterminism.Justin M. Keyes2016-10-23
|
* system('foo &', 'bar'): Show error, don't crash.Justin M. Keyes2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #3529 Closes #5241 In Vim, :echo system('cat - &', 'foo') works because for both system() and :! Vim writes input to a temp file and uses shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output() .. make_filter_cmd()). In Nvim, :echo system('cat - &', 'foo') fails because we write the input directly via pipes (shell.c:do_os_system()), but (per POSIX[1]) backgrounded process input stream is redirected from /dev/null (unless overridden by shell redirection; supported only by some shells [2]), so our writes are ignored, the process exits quickly, and if we are writing data larger than the buffer size we'll see EPIPE. This still works: :%w !tee > foo1358.txt & but this does not: :%w !tee foo1358.txt & though it *should* (why doesn't it?) because we still do the temp file dance in do_bang() .. do_filter(). [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02 [2] http://unix.stackexchange.com/a/71218
* test: execute_spec: Adjust screen assertion.Justin M. Keyes2016-10-15
| | | | | | The previous form was passing because it happens immediately before this form; but on a very fast(?) server the screen check might miss that form. It's also not really want we want to assert anyways.
* events: allow event processing in getchar()Björn Linse2016-10-15
| | | | | | this is consistent with vim, and is necessary for plugins that implement their own input modes using "getchar()" and still want to do async event processing.
* api: Establish API naming convention. (#5344)Justin M. Keyes2016-09-17
| | | | | | | | | | | | | | | | | | | | | old name: new name: -------------------------------------------------- nvim_name_to_color nvim_get_color_by_name nvim_get_current_buffer nvim_get_current_buf nvim_get_current_window nvim_get_current_win nvim_get_buffers nvim_list_bufs nvim_get_tabpages nvim_list_tabpages nvim_get_windows nvim_list_wins nvim_set_current_buffer nvim_set_current_buf nvim_set_current_window nvim_set_current_win nvim_change_directory nvim_set_current_dir nvim_tabpage_get_window nvim_tabpage_get_win nvim_tabpage_get_windows nvim_tabpage_list_wins nvim_win_get_buffer nvim_win_get_buf nvim_report_error nvim_err_writeln Helped-by: Björn Linse <bjorn.linse@gmail.com> Helped-by: ZyX <kp-pav@yandex.ru> Helped-by: James McCoy <jamessan@jamessan.com>
* api: add tests for calling the api from vimscriptBjörn Linse2016-08-31
|
* Mark some functional tests as pending in WindowsRui Abreu Ferreira2016-08-26
|
* tests: don't ignore highlights in various testsBjörn Linse2016-08-14
|
* timers: do not crash after processing events in the handlerBjörn Linse2016-08-10
|
* eval.c: rename capture() to execute() (#5132)Justin M. Keyes2016-07-31
|
* timers: make repeat=0 work one-shot (consistent with vim)Björn Linse2016-06-29
|
* timers: make timers work with zero timeoutBjörn Linse2016-06-29
|
* test: fix command_count_specBjörn Linse2016-06-23
| | | | The test hit wait_return if x or .x.swp exists in the project root directory.
* Merge #4697 'capture() function'.Justin M. Keyes2016-06-20
|\
| * Port capture() functionShougo Matsushita2016-05-27
| | | | | | | | https://groups.google.com/forum/#!msg/vim_dev/H3Z3ChSUh_4/beZs6KzYdBsJ
* | functests: Check logs in lua codeZyX2016-06-10
|/ | | | | | 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.
* cmdline: Redraw the cmdline after processing eventsBjörn Linse2016-05-24
| | | | | | | vim-patch:7.4.1603 TODO(bfredl): if we allow events in HITRETURN and ASKMORE states, we need to add the necessary redraws as well.
* eval: implement timers. vim-patch: 7.4.1578, 7.4.1831Björn Linse2016-05-24
| | | | | For the moment, timers are triggered during sleep, but not in wait-for-input modes, like press-RETURN or f_getchar()
* vim-patch:cb00f03KillTheMule2016-05-08
| | | | | | | | | Add missing test file. https://github.com/vim/vim/commit/cb00f039332d3188931035e9d07144546fdea78a Converted to a lua test. Change the tolerance of the test to avoid false positives on travis.
* Satisfy testlint.KillTheMule2016-04-28
| | | | For that, make luatest ignore the preload.lua files.
* functests: Make json_functions_spec use new NIL where appropriateZyX2016-04-18
|
* eval/encode: Make sure that encoder can encode NULL variablesZyX2016-04-18
| | | | | | | | | Adds two undocumented v: variables: _null_list and _null_dict because I do not know a reproducible way to get such lists (though I think I heard about this) and dictionaries (do not remember hearing about them). NULL strings are obtained using $XXX_UNEXISTENT_VAR_XXX. Fixes crash in json_encode($XXX_UNEXISTENT_VAR_XXX). Other added tests worked fine before this commit.
* functests: Replace \xXX escapes with \DDD in lua codeZyX2016-04-18
|
* eval/encode: Dump FF character correctlyZyX2016-04-18
|
* eval: Treat [] and [""] as any other empty stringZyX2016-04-18
|
* eval: Fix overflow in error message in f_json_decodeZyX2016-04-18
|
* documentation,functests: State that UTF-8-only support is intentionalZyX2016-04-18
|
* eval/decode: Accept `\r` as space characterZyX2016-04-18
|
* eval/decode: Reject even more numbersZyX2016-04-18
| | | | Rejects leading zeroes and numbers like 1.e+5 (decimal dot with missing number with signed exponent).
* eval/decode: Reject more numbers, accept 1e5ZyX2016-04-18
|
* eval/decode: Do not loose high surrogates followed by high surrogatesZyX2016-04-18
|
* eval/decode: Make sure that error messages do not cause overflowZyX2016-04-18
|
* eval/decode: Make sure that blank input does not crash NeovimZyX2016-04-18
|
* eval/decode: Make sure that U+00C3 is parsed correctlyZyX2016-04-18
|
* functests: Make sure that json functions are tested with C messagesZyX2016-04-18
|
* eval/decode: Rename brackets in error messagesZyX2016-04-18
| | | | | U+007D is officially RIGHT CURLY BRACKET. U+005D is officially RIGHT SQUARE BRACKET.
* encode: Handle incomplete surrogates like `\uSURR\uOTHR` properlyZyX2016-04-18
|
* encode: Fail to dump NaN and infinityZyX2016-04-18
| | | | Thanks to vim/vim#654
* eval: Rename json* functions to json_*ZyX2016-04-18
|
* eval/encode: Fix invalid UTF-8 strings handling:ZyX2016-04-18
| | | | 1. Do not allow reading past buffer end when creating error messages. 2. Fix surrogate pairs range, avoid magic constants.
* eval/encode: Fix non-utf-8 &encoding handling, add testsZyX2016-04-18
|