Monday, October 23, 2017

Re: Advice needed: best practices for vim plugin testing

On 19/10/2017 23:36, Marcin Szamotulski wrote:
> On 11:10 Thu 19 Oct , Felipe Vieira wrote:
>> Hi everyone,
>>
>> I've been trying to develop a plugin and I'm used to writing testing for the
>> softwares I develop. The problem is that I cannot find a suitable testing
>> platform for vim plugins.
>
> [...]
>
> Hi Felipe,
>
> I've been missing a testing suite for vim too. One possible solution is
> to use the same technique that vim is using itself to test the code.
> There are now bunch of assert functions (:h assert_equal(), etc.).

Here you may find a minimal script based on Vim functions:

https://gist.github.com/lifepillar/b5018945561e024eeb9fc57650fc5d61

Just write the tests at the top of the script using the above-mentioned
assert functions, then source it.

Depending of what you are looking for, that might be all you need. For
something more sophisticated than that, you may take a look at Vim's
own test suite, from which my snippet is derived.

Enjoy,
Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: