public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: jcr <ffi.appdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: TDD for Lua filters
Date: Sat, 18 Jun 2022 07:52:13 -0700 (PDT)	[thread overview]
Message-ID: <105db0c3-2956-4915-ba6a-dc3048b324c7n@googlegroups.com> (raw)
In-Reply-To: <e60c5df6203a41b8862f7a360b479ea8-NSENcxR/0n0@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1374 bytes --]

I use shelltestrunner <https://github.com/simonmichael/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...-NSENcxR/0n0@public.gmane.org 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.

[-- Attachment #1.2: Type: text/html, Size: 1929 bytes --]

  parent reply	other threads:[~2022-06-18 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AQHYgo+TK9VdmT6SQ0qqtZh51kr5pA==>
2022-06-17 21:19 ` denis.maier-NSENcxR/0n0
     [not found]   ` <e60c5df6203a41b8862f7a360b479ea8-NSENcxR/0n0@public.gmane.org>
2022-06-17 22:08     ` Bastien DUMONT
2022-06-18 14:52     ` jcr [this message]
     [not found]       ` <105db0c3-2956-4915-ba6a-dc3048b324c7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-06-20  9:01         ` AW: " denis.maier-NSENcxR/0n0
     [not found]           ` <24ebd7f15f2c49828d138e404924b589-NSENcxR/0n0@public.gmane.org>
2022-06-20  9:24             ` Bastien DUMONT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=105db0c3-2956-4915-ba6a-dc3048b324c7n@googlegroups.com \
    --to=ffi.appdev-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).