Commit Graph

27 Commits

Author SHA1 Message Date
Evgeni Chasnovski
fe9cbcb3a5
feat(api): nvim_exec2(), deprecate nvim_exec() #19032
Problem:
The signature of nvim_exec() is not extensible per ":help api-contract".

Solution:
Introduce nvim_exec2() and deprecate nvim_exec().
2023-03-25 09:58:48 -07:00
Justin M. Keyes
72652cbc46
feat(test): use nvim_exec in helpers.source() #16064
helpers.source() was a hack to work around the lack of anonymous
:source. Its "create tempfile" behavior is not a required part of most
tests that use it.

Some tests still need the old "create tempfile" behavior either because
they test SID behavior, or because of missing nvim_exec features: #16071
2022-03-27 10:25:55 -07:00
zeertzjq
2a6a93b665 test(old): move some tests from assert_spec.lua to test_assert.vim 2022-02-13 09:23:20 +08:00
Sean Dewar
7925f0b633
vim-patch:8.1.1909: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make a few more functions usable as a method.
e49fbff384
2021-08-12 22:35:24 +01:00
Sean Dewar
287a77ef51
vim-patch:8.1.1861: only some assert functions can be used as a method
Problem:    Only some assert functions can be used as a method.
Solution:   Allow using most assert functions as a method.
24278d2407

Port tests to assert_spec.lua.
2021-08-12 22:35:22 +01:00
erw7
5cf94effee
test, legacy/assert_spec.lua: fix few tests fail
Adjust failing tests to current behavior due to changes in assert_fails
behavior by fbd6a86.
2021-01-01 04:58:05 -05:00
Jan Edmund Lazo
e16f2cbd12
vim-patch:8.2.0539: comparing two NULL list fails
Problem:    Comparing two NULL list fails.
Solution:   Change the order of comparing two lists.
7b293c730b

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.
c85156bb89

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)
6d3a7213f5

vim-patch:8.2.1196: build failure with normal features

Problem:    Build failure with normal features.
Solution:   Add #ifdef.
83e7450053

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.
a4b442614c
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
ab69ea26dc
vim-patch:8.1.0819: a failed assert with a long string is hard to read
Problem:    A failed assert with a long string is hard to read.
Solution:   Shorten the assert message.
865767126e
2020-07-19 11:40:34 -04:00
Jan Edmund Lazo
b3e56957f8 vim-patch:8.1.0460: assert_fails() message argument #11051
Problem:    assert_fails() does not take a message argument
Solution:   Add the argument.
1307d1c003
2019-09-21 14:03:46 -07:00
Jan Edmund Lazo
8db9e82e3e
vim-patch:8.0.1770: assert functions don't return anything
Problem:    Assert functions don't return anything.
Solution:   Return non-zero when the assertion fails.
65a5464985
2019-09-16 23:42:44 -04:00
Jan Edmund Lazo
9d77a07686 vim-patch:8.0.1510: cannot assert beep #9938
Problem:    Cannot test if a command causes a beep.
Solution:   Add assert_beeps().
b48e96f61c
2019-04-25 14:31:33 +02:00
Jan Edmund Lazo
7f6c1d256f vim-patch:8.0.0254: error message of assert functions (#8488)
Problem:    When using an assert function one can either specify a message or
            get a message about what failed, not both.
Solution:   Concatenate the error with the message.
c7b831ca15
2018-06-07 09:59:45 +02:00
KunMing Xie
ceade2fe53 vim-patch:8.0.0186 (#7154)
Problem:    The error message from assert_notequal() is confusing.
Solution:   Only mention the expected value.

5869cf060e
2017-09-10 12:52:43 +02:00
ckelsel
5cd68b3900 vim-patch:8.0.0124 #7092
Problem:    Internal error for assert_inrange(1, 1).
Solution:   Adjust number of allowed arguments. (Dominique Pelle)

3421566376
2017-07-30 14:15:26 +02:00
James McCoy
d707b2a171
vim-patch:8.0.0478
Problem:    Tests use assert_true(0) and assert_false(1) to report errors.
Solution:   Use assert_report().

37175409d7
2017-06-06 06:15:16 -04:00
ZyX
65fb622000 functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs.
Already found at least two:

1. msgpackparse() will show internal error: hash_add() in case of duplicate
   keys, though it will still work correctly. Currently silenced.
2. ttimeoutlen was spelled incorrectly, resulting in option not being set when
   expected. Test was still functioning somehow though. Currently fixed.
2017-04-09 03:24:08 +03:00
James McCoy
adc6e636fe
vim-patch:7.4.2095
Problem:    Man test fails when run with the GUI.
Solution:   Adjust for different behavior of GUI.  Add assert_inrange().

61c04493b0

Only changes related to assert_inrange() were included, since we have a
distinct man plugin.
2017-02-27 21:40:16 -05:00
Shougo Matsushita
3bb388664d vim-patch:7.4.1565
Problem:    Crash when assert_equal() runs into a NULL string.
Solution:   Check for NULL. (Dominique) Add a test.

f155196444
2016-10-15 14:25:50 +09:00
James McCoy
452707e0b0 vim-patch:7.4.1703
Problem:    Can't assert for not equal and not matching.
Solution:   Add assert_notmatch() and assert_notequal().

b50e5f5686
2016-07-23 20:42:46 -04:00
James McCoy
aece3ffa7d vim-patch:7.4.1663
Problem:    In tests it's often useful to check if a pattern matches.
Solution:   Add assert_match().

ea6553bec3
2016-07-23 20:42:46 -04:00
Patrick
8e804c911e vim-patch:7.4.1136
Problem:    Wrong argument to assert_exception() causes a crash. (reported by
            Coverity)
Solution:   Check for NULL pointer.  Add a test.

da5dcd9366
2016-06-30 22:35:06 +10:00
ZyX
ff470bb853 functests: Check logs in lua code
It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
2016-06-10 21:50:49 +03:00
Michael Ennen
b1c9d7d237 vim-patch:7.4.1223
Problem:    Crash when setting v:errors to a number.
Solution:   Free the typval without assuming its type. (Yasuhiro Matsumoto)

a542c680a8
2016-06-09 21:18:09 -04:00
James McCoy
ccef5c9c77 vim-patch:7.4.1567
Problem:    Crash in assert_fails().
Solution:   Check for NULL. (Dominique Pelle)  Add a test.

1abb502635
2016-05-25 21:02:52 -04:00
watiko
59b04d856b tests: Make helper.source() return tempname. 2016-01-10 10:44:57 +09:00
watiko
feed81f45f tests: Fix OSX's tempname issue. 2016-01-10 10:44:57 +09:00
watiko
d8e07deff6 tests: Migrate legacy test assert. 2016-01-10 10:44:57 +09:00