Commit Graph

21 Commits

Author SHA1 Message Date
zeertzjq
bd122494cc vim-patch:8.2.2100: insufficient testing for function range and dict
Problem:    Insufficient testing for function range and dict.
Solution:   Add a few tests. (Dominique Pellé, closes vim/vim#7428)

67322bf74a
2022-10-27 08:30:16 +08:00
zeertzjq
245e6c5b30 test(old): test_lambda.vim garbagecollect() -> test_garbagecollect_now() 2022-10-27 08:25:28 +08:00
zeertzjq
7b39ce36a4 vim-patch:8.2.0418: code in eval.c not sufficiently covered by tests
Problem:    Code in eval.c not sufficiently covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5815)

8b63313510

Nvim does not have v:none, so comment out test for it.
2022-10-26 13:52:42 +08:00
zeertzjq
d5328ea408
vim-patch:8.2.0522: several errors are not tested for (#19901)
Problem:    Several errors are not tested for.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#5892)
ee4e0c1e9a

Omit Test_range() change: reverted in patch 8.2.0615.
Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195.
Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183.
Make uniq() error behavior consistent with sort().
Cherry-pick Test_set_ttytype() change from patch 8.1.1826.
Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim.
Test_viminfo_error() is applicable.
Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
2022-08-23 10:38:53 +08:00
zeertzjq
fe621b4ac0 vim-patch:8.1.0711: test files still use function!
Problem:    Test files still use function!.
Solution:   Remove the exclamation mark.  Fix overwriting a function.
1e1153600c

Some of the changes were already applied previously.
2022-02-07 05:34:20 +08:00
zeertzjq
62c8715ee9
vim-patch:8.1.2412: crash when evaluating expression with error (#17109) 2022-01-31 08:12:44 +08:00
Sean Dewar
e0bdc9b89c
fix(eval): cherry-pick emsg changes from v8.1.0736
v8.1.0736 made some changes for making some emsgs more specific.
Includes the change for Test_lambda_fails() in test_lambda.vim.
Adjust relevant functionaltests to expect the new emsgs.

This patch has been fully ported in my Blob port PR, but it hasn't been
merged yet, so just use what we need from it for now.

Required for v8.1.1821.
2021-08-12 17:16:33 +01:00
Jan Edmund Lazo
578b0b0b52
vim-patch:8.2.0499: calling a lambda is slower than evaluating a string
Problem:    Calling a lambda is slower than evaluating a string.
Solution:   Make calling a lambda faster. (Ken Takata, closes vim/vim#5727)
f10806b250

Port "uf_flags" constants from patch 8.2.1054 to sync with Vim.
Port user_func_error() from patch 8.2.0149.
Port Test_lambda_scope() changes from patch 8.1.0736 so that it passes.
2020-09-30 21:00:17 -04:00
Daniel Hahler
3566267e75
vim-patch:8.1.1738: testing lambda with timer is slow (#10590)
Problem:    Testing lambda with timer is slow.
Solution:   Do not test timer accuracy, only that it works. (Daniel Hahler,
            closes vim/vim#4723)
9bc4dde45d
2019-07-24 19:47:41 +02:00
Jan Edmund Lazo
2ea6d3ab97 vim-patch:8.1.0019: error when defining a Lambda with index of a function result
Problem:    Error when defining a Lambda with index of a function result.
Solution:   When not evaluating an expression and skipping a function call,
            set the return value to VAR_UNKNOWN.
b4518563c7
2019-03-15 22:13:32 -04:00
Marco Hinz
0afd452ef1
tests: load-adjust timer tests (oldtest) 2019-01-17 15:59:23 +01:00
Justin M. Keyes
b0ebf61d37 test: adjust time-sensitive tests
From test_alot.vim:
    Found errors in Test_lambda_with_timer():
    First run:
    function RunTheTest[35]..Test_lambda_with_timer line 19: Expected True but got 0
    Second run:
    function RunTheTest[35]..Test_lambda_with_timer line 19: Expected True but got 0

previously: #9220

- Timer tests are less reliable on Travis CI macOS 10.12/10.13.
  ref #6829
  ref e39dade80b
  ref de13113dc1
  ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452
  > We don't guarantee that a X ms timer is triggered during Y ms sleep
  > for any X<Y, though I would expect the load to be really bad for this
  > to happen with X=10ms, Y=40ms.
- Call test_garbagecollect_now(), as Vim does.
2018-11-30 05:25:20 +01:00
Justin M. Keyes
f8639dc99c
test: adjust time-sensitive tests (#9220)
- window_split_tab_spec.lua: Put cursor at bottom of :terminal buffer so
  that it follows output.
- inccommand_spec.lua: Increase timeout to allow 2nd retry.
- Timer tests are less reliable on Travis CI macOS 10.12/10.13.
  ref #6829
  ref e39dade80b
  ref de13113dc1
  ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452
  > We don't guarantee that a X ms timer is triggered during Y ms sleep
  > for any X<Y, though I would expect the load to be really bad for this
  > to happen with X=10ms, Y=40ms.
2018-11-10 11:12:04 +01:00
Michael Ennen
ef8701610b Allow lambdas to be used with jobs, timers and dictwatchers. 2017-02-14 17:38:19 -07:00
Michael Ennen
53fad45115 vim-patch:7.4.2137
Problem:    Using function() with a name will find another function when it is
            redefined.
Solution:   Add funcref().  Refer to lambda using a partial.  Fix several
            reference counting issues.

437bafe4c8
2017-02-14 17:38:18 -07:00
Michael Ennen
1f715ac1c1 vim-patch:7.4.2136
Problem:    Closure function fails.
Solution:   Don't reset uf_scoped when it points to another funccal.

5801644819
2017-02-14 17:38:18 -07:00
Michael Ennen
f59321e319 vim-patch:7.4.2120
Problem:    User defined functions can't be a closure.
Solution:   Add the "closure" argument. Allow using :unlet on a bound
            variable. (Yasuhiro Matsumoto, Ken Takata)

10ce39a0d5
2017-02-14 17:38:17 -07:00
Michael Ennen
9f6f7fe26d vim-patch:7.4.2119
Problem:    Closures are not supported.
Solution:   Capture variables in lambdas from the outer scope. (Yasuhiro
            Matsumoto, Ken Takata)

1e96d9bf98
2017-02-14 17:38:17 -07:00
Michael Ennen
a0ce663710 vim-patch:7.4.2076
Problem:    Syntax error when dict has '>' key.
Solution:   Check for endchar. (Ken Takata)

4f0383bc3f
2017-02-14 17:38:16 -07:00
Michael Ennen
bb7d0deb2f vim-patch:7.4.2044
Problem:    filter() and map() either require a string or defining a function.
Solution:   Support lambda, a short way to define a function that evaluates an
            expression. (Yasuhiro Matsumoto, Ken Takata)

069c1e7fa9
2017-02-14 17:38:16 -07:00
Michael Ennen
b0fc6108c9 vim-patch:7.4.1727
Problem:    Cannot detect a crash in tests when caused by garbagecollect().
Solution:   Add garbagecollect_for_testing().  Do not free a job if is still
            useful.

ebf7dfa6f1
2017-02-14 17:38:15 -07:00