Commit Graph

24 Commits

Author SHA1 Message Date
Lewis Russell
81fc27124b refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
zeertzjq
1da0f3494e
test: correct order of arguments to eq() (#27816) 2024-03-11 22:23:14 +08:00
Justin M. Keyes
c3836e40a2
build: enable lintlua for test/unit/ dir #26396
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.

Solution:
- Enable lintlua for `test/unit/` directory.
- TODO: only `test/functional/` remains unchecked.

previous: 45fe4d11ad
previous: 517f0cc634
2023-12-04 14:32:39 -08:00
zeertzjq
dc6d0d2daf
refactor: reorganize option header files (#25437)
- Move vimoption_T to option.h
- option_defs.h is for option-related types
- option_vars.h corresponds to Vim's option.h
- option_defs.h and option_vars.h don't include each other
2023-09-30 14:41:34 +08:00
zeertzjq
5b153f5d3d test: remove references to misc1.c 2021-12-11 07:10:01 +08:00
Justin M. Keyes
ecdd2df88a
shell/logging: Fix E730 with verbose system({List}) #9009
ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790

Steps to reproduce:
    :set verbose=9
    :call system(['echo'])
    E730: using List as a String
2018-09-21 09:20:04 +02:00
Jonathan de Boyne Pollard
838277e28a test: fix bashisms (#6791) 2017-06-01 00:46:00 +02:00
ZyX
8ef6cfa6ac unittests: Fix linter errors 2017-03-11 23:48:16 +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
Justin M. Keyes
395ef5642e shell_escape: rename; refactor
- rename to shell_xescape_xquote
- move to os/shell.c
- disallow NULL argument
- eliminate casts, nesting
- test: empty shellxquote/shellxescape
2016-09-11 03:04:57 +02:00
Zhaosheng Pan
0991041ae7 system(): Respect 'sxe' and 'sxq' #2789
Fixes #2773
2016-09-10 22:21:40 +02:00
ZyX
c571e80273 unittests: Also remove event_teardown
`event_teardown` is there from 974752c, by aktau. It was introduced with 
`init_homedir` and `event_init`. Then both were removed by justinmk in 
99a9161bac (`init_homedir`) and 
49c5689f45 (`event_init`), but `event_teardown` 
was not removed. Now this may cause a crash. More details in #4852.

Closes #4852
2016-05-31 15:41:24 +03:00
Justin M. Keyes
49c5689f45 test/unit: ensure event_init()
Closes #4635
References #4630
References https://github.com/neovim/neovim/pull/4070#discussion_r50626558
2016-04-25 00:42:44 -04:00
Justin M. Keyes
6e5343d230 test: shell_spec: rename variable 2016-04-24 23:58:11 -04:00
ZyX
3b7c4093e2 shell: Unquote &shell* options before using them 2016-01-11 05:24:44 +03:00
Marco Hinz
32ecd75a16 test/unit: clean up according to luacheck 2015-11-23 13:57:21 +01:00
Russ Adams
7be75a0291 test: os_system: spec for non-zero exit. #3419 2015-10-04 22:57:21 -04:00
Thiago de Arruda
991d3ec1e6 event loop: New abstraction layer with refactored time/signal API
- 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.
2015-07-17 00:19:19 -03:00
Scott Prager
1eb3396922 unify jobstart, termopen, and system interfaces
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>
2015-05-02 09:47:30 -04:00
Justin M. Keyes
99a9161bac unit tests: initialize everything 2014-09-11 08:58:17 +00:00
Nicolas Hillegeer
974752c53b test/shell: add tests
- The calls to (partially) initialize logging
  need to go. Blocked on #981.
2014-07-27 14:00:45 -03:00