summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/testing.c
AgeCommit message (Collapse)AuthorFiles
2026-02-22vim-patch:9.2.0031: Inefficient use of ga_concat()zeertzjq1
Problem: Inefficient use of ga_concat() Solution: Use ga_concat_len() when the length is already known to avoid use of strlen() (John Marriott). closes: vim/vim#19422 https://github.com/vim/vim/commit/ed202035b1904c84d92adb76d7e1a95b7540e048 Co-authored-by: John Marriott <basilisk@internode.on.net> Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-10-04vim-patch:partial:8.1.1939: code for handling v: variables in generic eval ↵Jan Edmund Lazo1
file (#35968) Problem: Code for handling v: variables in generic eval file. Solution: Move v: variables to evalvars.c. (Yegappan Lakshmanan, closes vim/vim#4872) https://github.com/vim/vim/commit/e5cdf153bcb348c68011b308c8988cea42d6ddeb Remove direct reference to "vimvars" for following functions: - assert_error() - get_vim_var_nr() - get_vim_var_list() - get_vim_var_dict() - get_vim_var_str() - set_cmdarg() - set_reg_var() - set_vcount() - set_vexception() - set_vthrowpoint() - set_vim_var_bool() - set_vim_var_dict() - set_vim_var_list() - set_vim_var_nr() - set_vim_var_special() - set_vim_var_string() - set_vim_var_type() Reorder functions based on v8.2.4930 for eval_one_expr_in_str() and eval_all_expr_in_str(). Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2024-08-10vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly ↵zeertzjq1
(#30018) Problem: assert_equal() doesn't show multibyte string correctly Solution: Properly advance over a multibyte char. (zeertzjq) closes: vim/vim#15456 https://github.com/vim/vim/commit/9c4b2462bb498f44044616f7309d111d12170369
2024-07-05vim-patch:9.1.0524: the recursive parameter in the *_equal functions can be ↵zeertzjq1
removed (#29572) Problem: the recursive parameter in the *_equal functions can be removed Solution: Remove the recursive parameter in dict_equal(), list_equal() object_equal and tv_equal(). Use a comparison of the static var recursive_cnt == 0 to determine whether or not tv_equal() has been called recursively (Yinzuo Jiang). closes: vim/vim#15070 https://github.com/vim/vim/commit/7ccd1a2e858dbb2ac7fb09971dfcbfad62baa677 Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-06-01refactor: move shared messages to errors.h #26214Justin M. Keyes1
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-11-30build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq1
FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-27refactor: rename types.h to types_defs.hdundargoc1
2023-11-27build(IWYU): fix includes for func_attr.hdundargoc1
2023-11-27build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq1
2023-11-19refactor: follow style guidedundargoc1
- reduce variable scope - prefer initialization over declaration and assignment
2023-11-19build: bump uncrustify versiondundargoc1
Biggest change is that uncrustify is silent during linting.
2023-11-12build: remove PVSdundargoc1
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
2023-05-28build: remove LOG_LIST_ACTIONS option and related codedundargoc1
It has not been used for a long time and the likelihood of it still working is low.
2023-05-16refactor: use xstrl{cpy,cat} on IObuff (#23648)ii141
Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-05-06vim-patch:9.0.1511: crash when using wrong arg types to assert_match() (#23507)zeertzjq1
Problem: Crash when using wrong arg types to assert_match(). Solution: Check for NULL pointer. (closes vim/vim#12349) https://github.com/vim/vim/commit/12e7a1fe7527e9e59adbe248a95b4b532e3ec58c
2023-05-05vim-patch:9.0.1507: assert message is confusing with boolean resultzeertzjq1
Problem: Assert message is confusing with boolean result. assert_inrange() replaces message instead of adding it. Solution: Don't put quotes around expected boolean value. Append message for assert_inrange(). (closes vim/vim#12342, closes vim/vim#12341) https://github.com/vim/vim/commit/53f5e51628b56ef9171671cd6e9970374036a084 Move assert_type_T to testing.c and remove ASSERT_INRANGE.
2023-05-05vim-patch:9.0.0846: using assert_fails() may cause hit-enter promptzeertzjq1
Problem: Using assert_fails() may cause hit-enter prompt. Solution: Set no_wait_return. (closes vim/vim#11522) https://github.com/vim/vim/commit/f220643c260d55d21a841a3c4032daadc41bc50b Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:9.0.0404: crash when passing invalid arguments to assert_fails()zeertzjq1
Problem: Crash when passing invalid arguments to assert_fails(). Solution: Check for NULL string. https://github.com/vim/vim/commit/1540d334a04d874c2aa9d26b82dbbcd4bc5a78de Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:9.0.0213: using freed memory with error in assert argumentzeertzjq1
Problem: Using freed memory with error in assert argument. Solution: Make a copy of the error. https://github.com/vim/vim/commit/249e1b903a9c0460d618f6dcc59aeb8c03b24b20 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:8.2.1953: Vim9: extra "unknown" error after other errorzeertzjq1
Problem: Vim9: extra "unknown" error after other error. Solution: Restore did_emsg count after EXEC instruction. (closes vim/vim#7254) Improve error message from assert_fails() https://github.com/vim/vim/commit/631e8f93458b102091d54c502f489c03e454d4da Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:8.2.4397: crash when using many composing characters in error ↵zeertzjq1
message (#23481) Problem: Crash when using many composing characters in error message. Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv(). https://github.com/vim/vim/commit/34f8117dec685ace52cd9e578e2729db278163fc Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:8.2.3221: Vim9: argument types are not checked at compile time ↵zeertzjq1
(#23480) Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks. (Yegappan Lakshmanan, closes vim/vim#8632) https://github.com/vim/vim/commit/a764e73d4ffc5d046807c757eaacb9b0a5408152 Cherry-pick test_assert.vim change from patch 8.2.3229. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-04vim-patch:8.2.1697: inconsistent capitalization of error messages (#23476)zeertzjq1
Problem: Inconsistent capitalization of error messages. Solution: Always start with a capital. https://github.com/vim/vim/commit/7707228aace9aff16434edf5377a354c6ad07316 Most of these errors are Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-07refactor: remove redundant const char * castsii141
2023-04-05refactor: make error message definitions constii141
message.c functions now take const char * as a format. Error message definitions can be made const.
2023-02-11refactor: replace char_u with char (#21901)dundargoc1
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
2023-01-26vim-patch:9.0.1245: code is indented more than necessary (#21998)zeertzjq1
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11879) https://github.com/vim/vim/commit/032713f8299abd92fcfb1e490d1ae5c1ecadde41 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-21refactor: use uint8_t for blobs and ga_append() (#21916)zeertzjq1
A blob is used as a sequence of bytes and usually accessed individually, not as as a NUL-terminuated string, so uint8_t should be better. Not sure about ga_append(), but using uint8_t leads to fewer casts.
2023-01-19refactor: replace char_u with char 25 (#21838)dundargoc1
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
2023-01-17refactor: replace char_u with char 22 (#21786)dundargoc1
Work on https://github.com/neovim/neovim/issues/459
2023-01-09refactor: replace char_u with char 18 (#21237)dundargoc1
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
2022-11-30vim-patch:8.2.5102: interrupt not caught in testzeertzjq1
Problem: Interrupt not caught in test. Solution: Consider an exception thrown in the current try/catch when got_int is set. Also catch early exit when not using try/catch. https://github.com/vim/vim/commit/8bea171f154845046239c61bdef50a8e0f12f643 Cherry-pick test changes from patch 8.2.0557. https://github.com/vim/vim/commit/bfe13ccc58ccb96f243a58309800410db1ccb52c Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-26refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-11-15build: allow IWYU to fix includes for all .c filesdundargoc1
Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
2022-11-11vim-patch:8.2.1919: assert_fails() setting emsg_silent changes normal ↵zeertzjq1
execution (#20998) Problem: Assert_fails() setting emsg_silent changes normal execution. Solution: Use a separate flag in_assert_fails. https://github.com/vim/vim/commit/28ee892ac4197421b3317f195512ca64cc56a5b4 Cherry-pick no_wait_return from patch 9.0.0846. Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05vim-patch:8.2.1632: not checking the context of test_fails()zeertzjq1
Problem: Not checking the context of test_fails(). Solution: Add the line number and context arguments. Give error if assert_fails() argument types are wrong. https://github.com/vim/vim/commit/44d6652d561d628d12e3ff7f6636ea7d1f805ced Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05vim-patch:8.2.1631: test_fails() does not check the context of the line numberzeertzjq1
Problem: test_fails() does not check the context of the line number. Solution: Use another argument to specify the context of the line number. https://github.com/vim/vim/commit/9bd5d879c2ecfbdbb168b090e12f4b89724a302e Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05vim-patch:8.2.1484: flaky failure in assert_fails()zeertzjq1
Problem: Flaky failure in assert_fails(). Solution: Only used fourth argument if there is a third argument. https://github.com/vim/vim/commit/9b02d64cff7664b9643205d6e23b08da688fe87a Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05vim-patch:8.2.1479: Vim9: error for list index uses wrong line numberzeertzjq1
Problem: Vim9: error for list index uses wrong line number. Solution: Set source line number. (closes vim/vim#6724) Add a way to assert the line number of the error with assert_fails(). https://github.com/vim/vim/commit/1d634542cf5ebcd1d5d83bd124b3e1d5e7c96c58 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05vim-patch:8.2.1199: not all assert functions are fully testedzeertzjq1
Problem: Not all assert functions are fully tested. Solution: Test more assert functions. https://github.com/vim/vim/commit/7177da9dd4d9a521c6141c6fbf7e9a4d6296ab05 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-05vim-patch:partial:8.2.1183: assert_fails() checks the last error messagezeertzjq1
Problem: assert_fails() checks the last error message. Solution: Check the first error, it is more relevant. Fix all the tests that rely on the old behavior. https://github.com/vim/vim/commit/9b7bf9e98f06ece595fed7a3ff53ecce89797a53 Skip test_listener.vim, test_textprop.vim, test_viminfo.vim. Skip test_python2.vim: affected line fails and hasn't been ported. Skip test_python3.vim: affected lines fail and haven't been ported. Skip CHECK_LIST_MATERIALIZE. Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-10-27vim-patch:8.2.4234: test_garbagecollect_now() does not check v:testingzeertzjq1
Problem: test_garbagecollect_now() does not check v:testing as documented. Solution: Give an error if v:testing is not set. https://github.com/vim/vim/commit/b3d83980d2ac0f7a25314270416f17af874ca269 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-09-09refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-08-25refactor: replace char_u with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-08-23perf(api): allow to use an arena for return valuesbfredl1
2022-08-15vim-patch:8.2.1653: expand('<stack>') does not include the final line numberzeertzjq1
Problem: Expand('<stack>') does not include the final line number. Solution: Add the line nuber. (closes vim/vim#6927) https://github.com/vim/vim/commit/4f25b1aba050b85fa97ca2316aa04dd4b0b22530
2022-08-15vim-patch:8.2.1297: when a test fails it's often not easy to see wherezeertzjq1
Problem: When a test fails it's often not easy to see what the call stack is. Solution: Add more entries from the call stack in the exception message. https://github.com/vim/vim/commit/a5d0423fa16f18b4576a2a07e50034e489587a7d Use docs from latest Vim.