From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30759 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jcr Newsgroups: gmane.text.pandoc Subject: Re: TDD for Lua filters Date: Sat, 18 Jun 2022 07:52:13 -0700 (PDT) Message-ID: <105db0c3-2956-4915-ba6a-dc3048b324c7n@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1518_970075890.1655563933794" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29700"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDQLFNXWVILBBH6NW6KQMGQEIVXRUKY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jun 18 16:52:19 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yw1-f192.google.com ([209.85.128.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o2ZoA-0007UQ-VQ for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 18 Jun 2022 16:52:18 +0200 Original-Received: by mail-yw1-f192.google.com with SMTP id 00721157ae682-2eb7d137101sf61290887b3.12 for ; Sat, 18 Jun 2022 07:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=Bn/c8/+HqST9+H2APZeN00boesZtKS1VPMk6FxNCnpI=; b=B6mHxHMfVt++s69Qrme3QDkJ63VZtWQixWDIKvXwNWguDO0vn4sDG/6YH/PNB9sYCt XSF4d6Lh+Yz/U2FW5I0u/Y0lwNZyCf1r1/6meEaLR80+zYQJnpLoZefmxCU5657Qz7pl HhN+WAoWcwxMHsLJhGX0A9Jx1qp6B58c09fQmOFuKiXDTU3Kp0ZXC82I9UpDkoYj4KIV Xa4uimk3yUbUl2pLwYGYVtXLvhdd/1+RaRcvk0ZybgHukw7aJ4aq+LhzApV7srWc7KsU lR3Z6xkZ3JE0Zzp5mY8iTaLn5fxKNahGEdnp9OlTjVZc2sKbx1KJZyA2lpOw+20dMu4q OpRg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=Bn/c8/+HqST9+H2APZeN00boesZtKS1VPMk6FxNCnpI=; b=WqN2uCXKS4BjYVJw2vSQpFyMPx2LLOHLKM9DaPVWVYQ23bywOsdf4wW/WFnbFKMQT0 qwENKMWkAcnw/cIYj+CQNEwdESbGipW/BYnZSWv/TMGsUmEo58isDluOiaIequKyHExe 2oia3jteu5rI2U080PyCyK0Kq1S+sRg1yE4OadF0S0yhReKC+iMx6yXalM0mEyZUpupX 1tecYrONSYtPGQ6xcl7FxLX0XKkuZohR1S0raB0jf9rakWd041PAxwNEjBhzMwAwKPZW 3SyfC76BpztJmQkD9prtE9Kgi7iOSGsUOaA+Kf+D2fbwxkOrh9V/ZByhG5hO2QRuL2JG /PjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=Bn/c8/+HqST9+H2APZeN00boesZtKS1VPMk6FxNCnpI=; b=5rMGB6VHPOg4lIpEmfRS/azmbIuh0+UyTgJ5Lrfm5sUBWpoX3dBz5UL60EalA1z3a3 Ym/2lel2nVEM9/0oQqFgLW67kTae0Dj5YtyJ19Nhe/uadtiYlezeGNRipkOWEHq63ooK h70N13rK1W2Aml5hRlpBr43Mt68jDiyLE0qI/mx2CxN08Nma2cxfAq3V35UWOQWqLJTv 3xFr+KhugKWVQUbrVHce6gV9tN10Z3Dtqf3X2Tn4pn4GhWiYmEHy2S0NNpLLI96cWjt9 S4+tejrJzjTVkq0rcAXGgfQsqZ18bpMHEjOktq02tTamAjiv1Nh+M4rqNWyqWQq1uOEV ZFFw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora+hM66C3Mti2nmQGBL4E8Ts45iWgi6CNr+gVNpJ79SDc6cBZHCe 5mKjzqpac3drtJYu21jaaQ4= X-Google-Smtp-Source: AGRyM1tDFRT2B2YsBifeOjqzv2VXis2YZtNaDl3bHokzyRC+cmdBYgnjsSB4xnv0O4PUILwn+P4CHQ== X-Received: by 2002:a25:9ac3:0:b0:664:736b:8f2e with SMTP id t3-20020a259ac3000000b00664736b8f2emr16160565ybo.589.1655563937908; Sat, 18 Jun 2022 07:52:17 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6902:1106:b0:663:d4ab:e52d with SMTP id o6-20020a056902110600b00663d4abe52dls4951896ybu.10.gmail; Sat, 18 Jun 2022 07:52:14 -0700 (PDT) X-Received: by 2002:a25:744b:0:b0:668:cd4c:39c2 with SMTP id p72-20020a25744b000000b00668cd4c39c2mr4429779ybc.52.1655563934558; Sat, 18 Jun 2022 07:52:14 -0700 (PDT) In-Reply-To: X-Original-Sender: ffi.appdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:30759 Archived-At: ------=_Part_1518_970075890.1655563933794 Content-Type: multipart/alternative; boundary="----=_Part_1519_765706492.1655563933794" ------=_Part_1519_765706492.1655563933794 Content-Type: text/plain; charset="UTF-8" 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...-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. ------=_Part_1519_765706492.1655563933794 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I use shel= ltestrunner for this: the input is a simple markdown document, the comm= and runs pandoc with the filter, and the output is the expected markdown. O= f course, it would be easy to use any other text-based input or output form= at 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 sl= ow, 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, y= ou can just compare the document produced with the filter against the expec= ted 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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.
------=_Part_1519_765706492.1655563933794-- ------=_Part_1518_970075890.1655563933794--