Commit Graph

23 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
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
a4132e1d62
test(unit): move statusline tests to statusline_spec.lua (#25441) 2023-09-30 20:38:04 +08:00
luukvbaal
364b131f42
feat(ui): add 'statuscolumn' option
Problem:    Unable to customize the column next to a window ('gutter').
Solution:   Add 'statuscolumn' option that follows the 'statusline' syntax,
	    allowing to customize the status column. Also supporting the %@
	    click execute function label. Adds new items @C and @s which
	    will print the fold and sign columns. Line numbers and signs
	    can be clicked, highlighted, aligned, transformed, margined etc.
2023-01-09 17:12:06 +00:00
zeertzjq
b2d984558b
test(unit): use file:close() properly (#21505) 2022-12-22 22:17:01 +08:00
luukvbaal
8147d3df28
vim-patch:9.0.0844: handling 'statusline' errors is spread out (#20992)
Problem:    Handling 'statusline' errors is spread out.
Solution:   Pass the option name to the lower levels so the option can be
            reset there when an error is encountered. (Luuk van Baal,
            closes vim/vim#11467)

7b224fdf4a
2022-11-08 07:21:22 +08:00
bfredl
6adc2ae7e0 refactor: move statusline code from buffer.c and [draw]screen.c to new file
problem: code for drawing statusline is arbitrarily spreadout between drawscreen.c, screen.c and buffer.c
solution: move it to a new file statusline.c

- rename archaic internal name "status match" to public name "wildmenu"
- showruler() does not show the ruler. it show anything which displays
  info about the cursor. Rename it accordingy.
2022-08-19 22:48:03 +02:00
Jun-ichi TAKIMOTO
285e738942
test(unit): use setup()/teardown() in buffer_spec.lua (#18739) 2022-05-28 10:14:12 +08:00
zeertzjq
44b59d1a69 vim-patch:8.2.0004: get E685 and E931 if buffer reload is interrupted
Problem:    Get E685 and E931 if buffer reload is interrupted.
Solution:   Do not abort deleting a dummy buffer. (closes vim/vim#5361)
a6e8f888e7
2022-04-08 08:54:07 +08:00
zeertzjq
be15ac06ba feat(statusline): support multibyte fillchar
This includes a partial port of Vim patch 8.2.2569 and some changes to
nvim_eval_statusline() to allow a multibyte fillchar. Literally every
line of C code touched by that patch has been refactored in Nvim, and
that patch contains some irrelevant foldcolumn tests I'm not sure how to
port (as Nvim's foldcolumn behavior has diverged from Vim's).
2022-01-16 19:54:27 +08:00
Rom Grk
10bf69a43e vim-patch:8.2.1909: number of status line items is limited to 80
Problem:    Number of status line items is limited to 80.
Solution:   Dynamically allocate the arrays. (Rom Grk, closes vim/vim#7181)
8133cc6bf4

The members of stl_item_T have not been prefixed with stl_ contrary to
the vim patch because the amount of stl_ prefixes on single lines of
code in that region was hurtful to readability.
2020-10-31 19:54:06 -04:00
ZviRackover
627cc1b3d8 test: build_stl_str_hl (#8703)
Improve coverage of `build_stl_str_hl`.
Minor removal of dead code in the tested function.
2018-07-10 20:46:40 +02: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
Björn Linse
a2d25b7bf8 api: unify buffer numbers and window ids with handles
also allow handle==0 meaning curbuf/curwin/curtab
2016-08-31 21:40:20 +02:00
TJ DeVries
aa22b5fd9a Add new functionality to the = marker in the STL
This new functionality is explained in the documentation.

Also, many tests have been added to the buffer_spec.lua file
2016-06-14 20:10:11 +02:00
Charles Joachim
55844eee10 buffer.c: change return type to bool
Co-authored-by: Wayne Rowcliffe (@war1025)
2016-04-03 15:39:33 -04:00
Marco Hinz
32ecd75a16 test/unit: clean up according to luacheck 2015-11-23 13:57:21 +01:00
Wayne Rowcliffe
70f6b0f338 Start adding unit tests 2015-11-11 21:19:52 -06:00
Thiago de Arruda
c8c5af5a7a test: Ensure proper initialization in unit/helpers.lua
Remove helpers.vim_init and simply perform the required initialization in
helpers.lua.
2015-07-01 05:40:53 -03:00
Justin M. Keyes
99a9161bac unit tests: initialize everything 2014-09-11 08:58:17 +00:00
Wayne Rowcliffe
7a2ea275eb Add tests for buffer.c and fileio.c 2014-07-22 05:28:17 -05:00