Hi Bram!
On So, 29 Nov 2015, Bram Moolenaar wrote:
>
> Testing Vim functionality has always been difficult. The tests in
> src/testdir are hard to write and even harder to read back.
>
> I have just sent out patch 7.4.944 which should make testing easier.
> This is what simple test looks like:
>
> func Test_assertFalse()
> call assertFalse(0)
> endfunc
>
> func Test_assertTrue()
> call assertTrue(1)
> call assertTrue(123)
> endfunc
>
> func Test_assertEqual()
> let s = 'foo'
> call assertEqual('foo', s)
> let n = 4
> call assertEqual(4, n)
> let l = [1, 2, 3]
> call assertEqual([1, 2, 3], l)
> endfunc
>
> The asserts are done where the value is available. No need to dig
> through an .ok file or diff the .ok file with an .out file and then
> guess where in the test something went wrong.
>
> The test script finds all the Test_ functions and executes them,
> collecting any error messages from the asserts.
>
> An important limitation is that this only works with the +eval feature.
> Testing a small or tiny Vim build still requires the old kind of
> testing.
>
> What do you think?
>
> Obviously we can add more assert functions and improve their error
> messages.
I appreciate it to make testing easier. Writing and debugging the old
tests are a huge PITA (sorry).
However, as of now, I don't know how this is supposed to be better. Most
of the tests I have written in the last time, were trying to test some
visual feature, so I don't know how the assert functions are going to
help with this.
I have to see how this works out, before I can make a final assessment.
Best,
Christian
--
Ideen sind ja nur das einzig wahrhaft Bleibende im Leben.
-- Wilhelm von Humboldt
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.