aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testing.c
Commit message (Collapse)AuthorAge
* vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly ↵zeertzjq2024-08-10
| | | | | | | | | | | (#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
* vim-patch:9.1.0524: the recursive parameter in the *_equal functions can be ↵zeertzjq2024-07-05
| | | | | | | | | | | | | | | 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>
* refactor: move shared messages to errors.h #26214Justin M. Keyes2024-06-01
|
* refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | 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.
* build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq2023-11-30
| | | | | | 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.
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: rename types.h to types_defs.hdundargoc2023-11-27
|
* build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
|
* build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq2023-11-27
|
* refactor: follow style guidedundargoc2023-11-19
| | | | | - reduce variable scope - prefer initialization over declaration and assignment
* build: bump uncrustify versiondundargoc2023-11-19
| | | | Biggest change is that uncrustify is silent during linting.
* build: remove PVSdundargoc2023-11-12
| | | | | | | 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.
* build: remove LOG_LIST_ACTIONS option and related codedundargoc2023-05-28
| | | | It has not been used for a long time and the likelihood of it still working is low.
* refactor: use xstrl{cpy,cat} on IObuff (#23648)ii142023-05-16
| | | | | Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff Co-authored-by: ii14 <ii14@users.noreply.github.com>
* vim-patch:9.0.1511: crash when using wrong arg types to assert_match() (#23507)zeertzjq2023-05-06
| | | | | | 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
* vim-patch:9.0.1507: assert message is confusing with boolean resultzeertzjq2023-05-05
| | | | | | | | | | | 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.
* vim-patch:9.0.0846: using assert_fails() may cause hit-enter promptzeertzjq2023-05-05
| | | | | | | | | 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>
* vim-patch:9.0.0404: crash when passing invalid arguments to assert_fails()zeertzjq2023-05-05
| | | | | | | | | 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>
* vim-patch:9.0.0213: using freed memory with error in assert argumentzeertzjq2023-05-05
| | | | | | | | | 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>
* vim-patch:8.2.1953: Vim9: extra "unknown" error after other errorzeertzjq2023-05-05
| | | | | | | | | | 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>
* vim-patch:8.2.4397: crash when using many composing characters in error ↵zeertzjq2023-05-05
| | | | | | | | | | 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>
* vim-patch:8.2.3221: Vim9: argument types are not checked at compile time ↵zeertzjq2023-05-05
| | | | | | | | | | | | (#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>
* vim-patch:8.2.1697: inconsistent capitalization of error messages (#23476)zeertzjq2023-05-04
| | | | | | | | | | 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>
* refactor: remove redundant const char * castsii142023-04-07
|
* refactor: make error message definitions constii142023-04-05
| | | | message.c functions now take const char * as a format. Error message definitions can be made const.
* refactor: replace char_u with char (#21901)dundargoc2023-02-11
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* vim-patch:9.0.1245: code is indented more than necessary (#21998)zeertzjq2023-01-26
| | | | | | | | | 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>
* refactor: use uint8_t for blobs and ga_append() (#21916)zeertzjq2023-01-21
| | | | | | 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.
* refactor: replace char_u with char 25 (#21838)dundargoc2023-01-19
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 22 (#21786)dundargoc2023-01-17
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 18 (#21237)dundargoc2023-01-09
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.5102: interrupt not caught in testzeertzjq2022-11-30
| | | | | | | | | | | | | | 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>
* refactor: replace char_u with charDundar Göc2022-11-26
| | | | Work on https://github.com/neovim/neovim/issues/459
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | 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.
* vim-patch:8.2.1919: assert_fails() setting emsg_silent changes normal ↵zeertzjq2022-11-11
| | | | | | | | | | | | 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>
* vim-patch:8.2.1632: not checking the context of test_fails()zeertzjq2022-11-05
| | | | | | | | | | 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>
* vim-patch:8.2.1631: test_fails() does not check the context of the line numberzeertzjq2022-11-05
| | | | | | | | | 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>
* vim-patch:8.2.1484: flaky failure in assert_fails()zeertzjq2022-11-05
| | | | | | | | | 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>
* vim-patch:8.2.1479: Vim9: error for list index uses wrong line numberzeertzjq2022-11-05
| | | | | | | | | | 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>
* vim-patch:8.2.1199: not all assert functions are fully testedzeertzjq2022-11-05
| | | | | | | | | 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>
* vim-patch:partial:8.2.1183: assert_fails() checks the last error messagezeertzjq2022-11-05
| | | | | | | | | | | | | | | 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>
* vim-patch:8.2.4234: test_garbagecollect_now() does not check v:testingzeertzjq2022-10-27
| | | | | | | | | 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>
* refactor: replace char_u with charDundar Göc2022-09-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Goc2022-08-25
| | | | Work on https://github.com/neovim/neovim/issues/459
* perf(api): allow to use an arena for return valuesbfredl2022-08-23
|
* vim-patch:8.2.1653: expand('<stack>') does not include the final line numberzeertzjq2022-08-15
| | | | | | 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
* vim-patch:8.2.1297: when a test fails it's often not easy to see wherezeertzjq2022-08-15
| | | | | | | | | 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.
* vim-patch:8.2.0056: execution stack is incomplete and inefficientzeertzjq2022-08-14
| | | | | | | | | | | Problem: Execution stack is incomplete and inefficient. Solution: Introduce a proper execution stack and use it instead of sourcing_name/sourcing_lnum. Create a string only when used. https://github.com/vim/vim/commit/1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 Omit test_debugger.vim: superseded by later patches. Omit check_map_keycodes(): N/A. Omit kword_test.c: N/A (converted to a unit test).
* vim-patch:8.2.0969: assert_equal() output for dicts is hard to figure out ↵zeertzjq2022-07-13
| | | | | | | (#19317) Problem: Assert_equal() output for dicts is hard to figure out. Solution: Only show the different items. https://github.com/vim/vim/commit/4a021dfbeee88ac09d07e257912485314ecdcabe
* vim-patch:8.2.0035: saving and restoring called_emsg is clumsy (#19335)zeertzjq2022-07-13
| | | | | Problem: Saving and restoring called_emsg is clumsy. Solution: Count the number of error messages. https://github.com/vim/vim/commit/53989554a44caca0964376d60297f08ec257c53c