summaryrefslogtreecommitdiffstatshomepage
path: root/test/unit/eval
AgeCommit message (Collapse)AuthorFiles
2026-02-16vim-patch:8.2.3841: Vim9: outdated TODO items, disabled tests that work (#37900)zeertzjq1
Problem: Vim9: outdated TODO items, disabled tests that work. Solution: Remove TODO items, run tests that work now. Check that a dict item isn't locked. https://github.com/vim/vim/commit/71b768509250b12696e8cc90e5902029f1b5433d Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-01-15fix(typval): allocated dynamic size must be at least the static sizebfredl1
fixes #37160
2025-09-26test(unit): disable JIT when using mocks (#35913)zeertzjq1
This fixes the flaky eval/typval_spec.lua tests.
2025-03-03refactor(messages): simplify message historyLuuk van Baal2
2024-08-05refactor(shada): rework msgpack decoding without msgpack-cbfredl1
This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
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-05-25test(unit): skip flaky 'typval.c dict extend() works' testdundargoc1
2024-04-10refactor(test): inject after_each differentlyLewis Russell6
2024-04-08test: improve test conventionsdundargoc6
Work on https://github.com/neovim/neovim/issues/27004.
2024-03-29test: skip flaky testsdundargoc1
2024-03-28test: skip flaky testsdundargoc1
2024-01-12test: do not inject vim module into global helpersLewis Russell1
2023-12-04build: enable lintlua for test/unit/ dir #26396Justin M. Keyes6
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: 45fe4d11add933df76a2ea4bf52ce8904f4a778b previous: 517f0cc634b985057da5b95cf4ad659ee456a77e
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-08-15vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)zeertzjq1
Problem: Cannot use positional arguments for printf() Solution: Support positional arguments in string formatting closes: vim/vim#12140 https://github.com/vim/vim/commit/0c6181fec4c362eb9682d5af583341eb20cb1af5 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-06-12test(unit/eval/typval_spec): adjust for Float to String conversionSean Dewar1
Adjust relevant Lua tests. Refactor testing logic for tv_get_string_* functions into test_string_fn(). Note that vim_snprintf(), which is used for stringifying floats, always calls xfree(tofree), even if tofree is NULL, so we need to expect that in the alloc log.
2023-06-12test(unit/eval/typval_spec): don't dereference NULL last_msg_histSean Dewar1
If last_msg_hist is NULL, check_emsg will cause the running test process to SIGSEGV from trying to access the msg member.
2023-05-05vim-patch:9.0.0250: slightly inconsistent error messageszeertzjq1
Problem: Slightly inconsistent error messages. Solution: Make it "Using a Float". (closes vim/vim#10959) https://github.com/vim/vim/commit/dde77a7c4d72622284dc5fb72557bde42c314fa6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq1
Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05vim-patch:8.2.3135: Vim9: builtin function arguments not checked at compile timezeertzjq1
Problem: Vim9: builtin function arguments not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes vim/vim#8539) https://github.com/vim/vim/commit/5b73992d8f82be7ac4b6f46c17f53ffb9640e5fa Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-14vim-patch:8.2.1047: Vim9: script cannot use line continuation like :def functionzeertzjq1
Problem: Vim9: script cannot use line continuation like in a :def function. Solution: Pass the getline function pointer to the eval() functions. Use it for addition and multiplication operators. https://github.com/vim/vim/commit/5409f5d8c95007216ae1190565a7a8ee9ebd7100 Omit source_nextline() and eval_next_non_blank(): Vim9 script only. N/A patches for version.c: vim-patch:8.2.1048: build failure without the eval feature Problem: Build failure without the eval feature. Solution: Add dummy typedef. https://github.com/vim/vim/commit/9d40c63c7dc8c3eb3886c58dcd334bc7f37eceba vim-patch:8.2.1052: build failure with older compilers Problem: Build failure with older compilers. Solution: Move declaration to start of block. https://github.com/vim/vim/commit/7acde51832f383f9a6d2e740cd0420b433ea841a Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14vim-patch:8.2.{0695,0725,0734,0753,0818,0819,0822} (#23075)zeertzjq1
vim-patch:8.2.0695: Vim9: cannot define a function inside a function Problem: Vim9: cannot define a function inside a function. Solution: Initial support for :def inside :def. https://github.com/vim/vim/commit/04b12697838b232b8b17c553ccc74cf1f1bdb81c vim-patch:8.2.0725: Vim9: cannot call a function declared later in Vim9 script Problem: Vim9: cannot call a function declared later in Vim9 script. Solution: Make two passes through the script file. https://github.com/vim/vim/commit/09689a02840be40fa7bb10b1921fb5bc5b2908f1 vim-patch:8.2.0734: Vim9: leaking memory when using :finish Problem: Vim9: leaking memory when using :finish. Solution: Do not check for next line in third pass. https://github.com/vim/vim/commit/04816717dfea6e2469ff4c9d40f68b59aaf03724 vim-patch:8.2.0753: Vim9: expressions are evaluated in the discovery phase Problem: Vim9: expressions are evaluated in the discovery phase. Solution: Bail out if an expression is not a constant. Require a type for declared constants. https://github.com/vim/vim/commit/32e351179eacfc84f64cd5029e221582d400bb38 vim-patch:8.2.0818: Vim9: using a discovery phase doesn't work well Problem: Vim9: using a discovery phase doesn't work well. Solution: Remove the discovery phase, instead compile a function only when it is used. Add :defcompile to compile def functions earlier. https://github.com/vim/vim/commit/822ba24743af9ee1b5e7f656a7a61a38f3638bca vim-patch:8.2.0819: compiler warning for unused variable Problem: Compiler warning for unused variable. Solution: Remove the variable. https://github.com/vim/vim/commit/f40e51a880a95f94dbbbecc9476559506c2cc345 vim-patch:8.2.0822: Vim9: code left over from discovery phase Problem: Vim9: code left over from discovery phase. Solution: Remove the dead code. https://github.com/vim/vim/commit/2eec37926db6d31beb36f162ac00357a30c093c8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-02refactor: remove char_u (#22829)dundargoc1
Closes https://github.com/neovim/neovim/issues/459
2023-03-23fix(api): make nvim_get_hl return 'cterm' attrs properlybfredl1
2023-01-31fix(test): fix issues detected by running unittests in ASAN/UBSANbfredl1
2023-01-19vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 ↵zeertzjq1
(#21883) Problem: Cannot lock a variable in legacy Vim script like in Vim9. Solution: Make ":lockvar 0" work. https://github.com/vim/vim/commit/a187c43cfe8863d48b2159d695fedcb71f8525c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-18fix(unittests): fix TUI broken test previously ignoredbfredl1
2022-10-26vim-patch:8.2.1852: map() returing zero for NULL list is unexpectedzeertzjq1
Problem: map() returing zero for NULL list is unexpected. Solution: Return the empty list. (closes vim/vim#7133) https://github.com/vim/vim/commit/ffdf8adfa8108d4765fdc68abbd2fe49a4292b25 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-08-13vim-patch:7.4.1168 (#19645)zeertzjq1
Problem: This doesn't give the right result: eval(string(v:true)). (Nikolay Pavlov) Solution: Make the string "v:true" instead of "true". https://github.com/vim/vim/commit/f48aa160fdd7b8caa7678e1a2139244dd2bdc547
2021-09-16vim-patch:8.2.1473: items in a list given to :const can still be modifiedSean Dewar1
Problem: Items in a list given to :const can still be modified. Solution: Work like ":lockvar! name" but don't lock referenced items. Make locking a blob work. https://github.com/vim/vim/commit/021bda56710d98c09a6b35610a476ab2dd8c58ad
2021-06-26vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)Jan Edmund Lazo1
Problem: Can modify a:000 when using a reference. Solution: Make check for locked variable stricter. (Ozaki Kiichi, closes vim/vim#3930) https://github.com/vim/vim/commit/05c00c038bc16e862e17f9e5c8d5a72af6cf7788
2020-07-19vim-patch:8.2.0539: comparing two NULL list failsJan Edmund Lazo1
Problem: Comparing two NULL list fails. Solution: Change the order of comparing two lists. https://github.com/vim/vim/commit/7b293c730b07d1586688e622b8d9cbbb4a52379b N/A patches for version.c: vim-patch:8.2.1187: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Disable Test_zz2_terminal_guioptions_bang() for now. https://github.com/vim/vim/commit/c85156bb897085d7f5a8e4e180287f87bf19b948 vim-patch:8.2.1188: memory leak with invalid json input Problem: Memory leak with invalid json input. Solution: Free all keys at the end. (Dominique Pellé, closes vim/vim#6443, closes vim/vim#6442) https://github.com/vim/vim/commit/6d3a7213f58da834b0fc869d05f87e86010c66cf vim-patch:8.2.1196: build failure with normal features Problem: Build failure with normal features. Solution: Add #ifdef. https://github.com/vim/vim/commit/83e7450053399942e1c9efa802c568b51d948541 vim-patch:8.2.1198: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Move test function to terminal3 to see if the problem moves too. https://github.com/vim/vim/commit/a4b442614c5ca4ebf32acf5cf0b7b718496f1c94
2020-06-06vim-patch:8.2.0111: VAR_SPECIAL is also used for booleansBilly Su2
Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking. https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
2020-04-28gen_api_dispatch.lua: allow msgpack int for Float args; test: add ↵Yatao Li1
ui_pum_set_bounds and tv_dict_add_float tests
2020-02-18lua: move test helper function, map and filter, to vim.shared moduleHirokazu Hata1
2020-01-05vim-patch:8.1.1579: dict and list could be GC'ed while displaying errorJan Edmund Lazo1
Problem: Dict and list could be GC'ed while displaying error in a timer. (Yasuhiro Matsumoto) Solution: Block garbage collection when executing a timer. Add test_garbagecollect_soon(). Add "no_wait_return" to test_override(). (closes vim/vim#4571) https://github.com/vim/vim/commit/adc6714aac20f5462a0ecec50ab4806b2f3ab0db
2019-05-18test: remove use of require('test.helpers')Justin M. Keyes1
The test.functional.helpers and test.unit.helpers modules now include all of the public functions from test.helpers, so there is no need to separately require('test.helpers').
2018-01-14*: Provide list length when allocating listsZyX2
2017-12-24*: Fix linter errorsZyX1
2017-12-24eval: Replace some tv_list_item_remove() callsZyX1
There is nothing wrong with them, just it is generally better to remove a range then to remove items individually.
2017-12-24eval: Rename tv_list_remove_items() to tv_list_drop_items()ZyX1
tv_list_remove_items() may cause confusion with tv_list_item_remove()
2017-12-24eval/typval: Make tv_list_item_remove return pointer to the next itemZyX1
2017-12-24eval/typval: Remove tv_list_item_free() as it is unusedZyX2
2017-12-24eval/typval: Make tv_list_item_alloc staticZyX1
Better write this bit in lua then make reviewers or clint filter out tv_list_item_alloc().
2017-12-24*: Remove most calls to tv_list_item_allocZyX1
Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the only reason why function did not receive `static` modifier.
2017-10-08viml/parser/expressions: Start creating expressions parserZyX1
Currently supported nodes: - Register as it is one of the simplest value nodes (even numbers are not that simple with that dot handling). - Plus, both unary and binary. - Parenthesis, both nesting and calling. Note regarding unit tests: it stores data for AST in highlighting in strings in place of tables because luassert fails to do a good job at representing big tables. Squashing a bunch of data into a single string simply yields more readable result.
2017-07-02unittests: Fix allocation ordering for tv_dict_add_str()ZyX1
2017-07-02eval/typval: Add tv_dict_add_allocated_str() functionZyX1
2017-05-10eval: Refactor get_user_input to support dictionaryZyX1
2017-04-14unittests: Add a test for TV_CSTRINGZyX1
Not using enum{} because SIZE_MAX exceeds integer and I do not really like how enum definition is described in C99: 1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type to choose is still implementation-defined. 2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration constant has type `int`”. So it looks like “no matter what type was chosen for enumeration, constants will be integers”. Yet the following simple program: #include <stdint.h> #include <stdio.h> #include <stddef.h> enum { X=SIZE_MAX }; int main(int argc, char **argv) { printf("x:%zu m:%zu t:%zu v:%zu", sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X); } yields one of the following using different compilers: - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615` - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161` If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8 v:4294967295`, other compilers’ output does not change. All compilers were called with `$compiler -std=c99 -xc -` (feeding program from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to ignore the argument though: it is perfectly fine with `-std=c1000`.