Thanks for the hints. I will have a look. Shelltestrunner looks quite interesting, but a simple makefile as described by Bastien might be already enough. (At least, this is also what seems to be used in the pandoc-lua-filters repo...)

 

Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von jcr
Gesendet: Samstag, 18. Juni 2022 16:52
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: TDD for Lua filters

 

I use shelltestrunner for this: the input is a simple markdown document, the command runs pandoc with the filter, and the output is the expected markdown. Of course, it would be easy to use any other text-based input or output format that pandoc supports. I also use this to test the CSL style I developed: I can supply a reference to format in a YAML block in the input, and use `markdown-citations` as the output format to check the formatted result.

 

The only disadvantage is that testing is a bit slow, because pandoc is invoked once for every test case.

 

On Friday, June 17, 2022 at 11:19:15 PM UTC+2 denis...@unibe.ch wrote:

Hi
Is there any way to use tests when developing Lua filters? Of course, you can just compare the document produced with the filter against the expected output with diff or so, but maybe there's a better approach...?

All the best,
Denis

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/105db0c3-2956-4915-ba6a-dc3048b324c7n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/24ebd7f15f2c49828d138e404924b589%40unibe.ch.