aboutsummaryrefslogtreecommitdiff
path: root/test/unit
Commit message (Collapse)AuthorAge
...
* 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.
* unittests: Also remove event_teardownZyX2016-05-31
| | | | | | | | | `event_teardown` is there from 974752c, by aktau. It was introduced with `init_homedir` and `event_init`. Then both were removed by justinmk in 99a9161bace8200aa611f6feefcc2ac3eda93251 (`init_homedir`) and 49c5689f45b9f222ed58e18e55678df7fb971ee8 (`event_init`), but `event_teardown` was not removed. Now this may cause a crash. More details in #4852. Closes #4852
* Merge pull request #4198 from daynin/string-testsJustin M. Keyes2016-05-29
|\ | | | | tests: add tests for vim_strsave_escaped() function
| * add test for vim_strsave_escaped() functionSergey Golovin2016-05-29
| |
* | os_nodetype: Return NODE_NORMAL if os_stat fails.Justin M. Keyes2016-05-22
| | | | | | | | | | | | | | | | Conforms to Vim's mch_nodetype. Regression by 7db4a15. buf_write() expects NODE_WRITABLE for character devices such as /dev/stderr. Closes #4772
* | test/functional: clear the temp directory before each tempfile testJohn Szakmeister2016-05-06
| | | | | | | | | | | | | | It's possible that the first test encounters a temp directory with files in it, due to a previous test causing the first test to fail. Instead, let's clean up before and after the test to make sure the temp area is pristine before and after the test.
* | Merge pull request #4654 from KillTheMule/testlintJustin M. Keyes2016-05-06
|\ \ | | | | | | Satisfy testlint.
| * | Satisfy testlint.KillTheMule2016-04-28
| | | | | | | | | | | | For that, make luatest ignore the preload.lua files.
* | | vim-patch:7.4.672KillTheMule2016-05-02
|/ / | | | | | | | | | | | | | | | | | | | | Problem: When completing a shell command, directories in the current directory are not listed. Solution: When "." is not in $PATH also look in the current directory for directories. https://github.com/vim/vim/commit/b5971141dff0c69355fd64196fcc0d0d071d4c82 Most of it applied manually.
* | test/unit: ensure event_init()Justin M. Keyes2016-04-25
| | | | | | | | | | | | Closes #4635 References #4630 References https://github.com/neovim/neovim/pull/4070#discussion_r50626558
* | test: shell_spec: rename variableJustin M. Keyes2016-04-24
| |
* | Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
| |
* | 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/decode: Do not overflow when parsing `-`ZyX2016-04-18
| | | | | | Also makes if’s less nested.
* | eval/decode: Make sure that error messages do not cause overflowZyX2016-04-18
| |
* | eval/decode: Make sure that parsing strings does not overflowZyX2016-04-18
| |
* | eval/decode: Avoid overflow when parsing incomplete null/true/falseZyX2016-04-18
| | | | | | | | Note: second test does not crash or produce asan errors, even though it should.
* | eval/encode: Fix writing strings starting with NL to listZyX2016-04-18
| | | | | | | | | | | | Error [found][1] by oni-link. [1]: https://github.com/neovim/neovim/pull/4131/files#r52239384
* | mbyte_spec.lua: Fix indentationoni-link2016-04-17
| |
* | mbyte_spec.lua: Fix wordingoni-link2016-04-17
| |
* | mbyte.c: Unittest for utfc_ptr2char_len()oni-link2016-04-15
| |
* | buffer.c: change return type to boolCharles Joachim2016-04-03
|/ | | | Co-authored-by: Wayne Rowcliffe (@war1025)
* Tests: fix according to lualintMarco Hinz2016-02-02
|
* misc: UNIX => Unix #4022Seth Jackson2016-01-16
| | | | | | | | | | Although UNIX is a registered trademark of The Open Group, it doesn't really matter whether we refer to these systems as UNIX, Unix, or Unix-like. So, for consistency, refer to them collectively as Unix. Related: http://www.greens.org/about/unix.html http://www.unixica.com/html/unixunix.html
* test: sys/fcntl.h -> fcntl.hMichael Reed2016-01-14
| | | | | | | | | POSIX.1-2008[1] says that the latter should be used, and all of our supported platforms would seem to support this scheme, apparently even Windows[2]. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html [2]: https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx
* shell: Unquote &shell* options before using themZyX2016-01-11
|
* Use libuv errors instead of errno in unit testsRui Abreu Ferreira2015-11-25
| | | | | | | | Replaced old unit tests for errno with libuv error codes UV_ENOENT and UV_EEXIST (for os_open and os_getperms). Added libuv include path to test/includes compiler calls - needed to get hold of libuv headers.
* test/unit: clean up according to luacheckMarco Hinz2015-11-23
|
* Start adding unit testsWayne Rowcliffe2015-11-11
|
* os/fs: Allow os_mkdir_recurse directory name to end with ///ZyX2015-10-23
|
* test: os_system: spec for non-zero exit. #3419Russ Adams2015-10-04
|
* os/path: Fix path_get_absolute_path for top-level pathsThiago de Arruda2015-09-18
| | | | Close #2833
* os/fs.c: remove os_file_is_readonly()Justin M. Keyes2015-08-17
| | | | | | | | | | | | | | | | | | | os_file_is_readonly() in its current form is equivalent to !os_file_is_writable(). This does not appear to be a bug, because Vim's use of check_file_readonly() (which we changed to os_file_is_readonly()) is equivalent to !os_file_is_writable() in every case. os_file_is_readonly() also fails this test: returns false if the file is non-read, non-write A more useful form would define behavior under these cases: - path is executable (but not writable) - path is non-existent - path is directory But there is no reason for os_file_is_readonly() to exist, so remove it.
* test: more cases for os_file_is_readonly()Justin M. Keyes2015-08-17
|
* test: cover os_file_is_readable()Justin M. Keyes2015-08-17
|
* queue: Implement a more flexible event queueThiago de Arruda2015-08-13
|
* test: fix pending() invocationsJustin M. Keyes2015-08-09
| | | | | AFAICT busted does not report pending() invocations without the 2nd argument.
* os/fs: Move mkdir_recurse from eval.c to os/fs.cZyX2015-07-26
|
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
* rbuffer: Reimplement as a ring buffer and decouple from rstreamThiago de Arruda2015-07-01
| | | | | | | | | | | | | | | | | | | | Extract the RBuffer class from rstream.c and reimplement it as a ring buffer, a more efficient version that doesn't need to relocate memory. The old rbuffer_read/rbuffer_write interfaces are kept for simple reading/writing, and the RBUFFER_UNTIL_{FULL,EMPTY} macros are introduced to hide wrapping logic when more control is required(such as passing the buffer pointer to a library function that writes directly to the pointer) Also add a basic infrastructure for writing helper C files that are only compiled in the unit test library, and use this to write unit tests for RBuffer which contains some macros that can't be accessed directly by luajit. Helped-by: oni-link <knil.ino@gmail.com> Reviewed-by: oni-link <knil.ino@gmail.com> Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com>
* test: Ensure proper initialization in unit/helpers.luaThiago de Arruda2015-07-01
| | | | | Remove helpers.vim_init and simply perform the required initialization in helpers.lua.
* tests: Use pending() instead of silently skipping test. #2737Florian Walch2015-05-29
|
* unify jobstart, termopen, and system interfacesScott Prager2015-05-02
| | | | | | | | | | | | | | | | | For any of these functions, if {cmd} is a string, execute "&shell &shellcmdflag '{cmd}'", or simply {cmd} if it's a list. In termopen(), if the 'name' option is not supplied, try to guess using '{cmd}' (string) or {cmd}[0] (list). Simplify ex_terminal to use the string form of termopen(). termopen: get name from argument Convert list_to_argv to tv_to_argv. Helped-by: Björn Linse <@bfredl> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: Thiago de Arruda <@tarruda>
* Implement os_unsetenv()Rui Abreu Ferreira2015-04-14
| | | | | | | - In UNIX systems where unsetenv() is available, it is used. Otherwise the variables are set with the empty string. - New check HAVE_UNSETENV for unsetenv() - Added unit test to env_spec.lua
* tests: Fix test setup/teardown in path_spec.lua #2402David Bürgin2015-04-12
| | | | | | | | A call to lfs.mkdir instead of lfs.rmdir left a temp directory hanging around. Changed to do proper setup/teardown using {before,after}_each. Helped-by: Scott Prager <splinterofchaos@gmail.com> Suggested-by: Scott Prager <splinterofchaos@gmail.com>
* Use lfs.currentdir() to fix symlink test fail.Rich Churcher2015-04-01
|
* path_fix_case: unit testScott Prager2015-03-31
|
* refactor: add tests for env_expand_escbobtwinkles2015-03-24
|
* tests: prevent busted from reloading the ffi module and othersJohn Szakmeister2015-03-01
| | | | | | | | | | | It turns out that Busted started cleaning the environment in 2.0rc5 as a result of Olivine-Labs/busted#62. This, in turn, caused the ffi module to be reloaded for each spec file, and LuaJIT doesn't appreciate it. The net effect is an assertion error in LuaJIT. By using the --helper feature of Busted, we can pre-load some modules ahead of Busted and prevent it from reloading them--making LuaJIT happy again.