How to write tests for a lua filter #10323
-
Hi, I am trying to write tests using When I do: function CodeBlock(el)
print("code block")
return el
end It works, by which I mean: I can see the output "code block" when compiling a markdown with a code block using this filter. return {
CodeBlock = function(el)
print("code block")
return CodeBlock(el)
end,
} pandoc does not pick up on But, my problem is that I cannot get the first version to work for testing with busted because I am unable to import the module as a simple My pandoc version: > pandoc --version
pandoc 3.1.11.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/nathan/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose. Thanks for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Do you want |
Beta Was this translation helpful? Give feedback.
-
As an answer to the general question of how to test filters: I asked myself the same thing, and ended up writing perevir for that. It's work in progress, but it's already serving me well. |
Beta Was this translation helpful? Give feedback.
As an answer to the general question of how to test filters: I asked myself the same thing, and ended up writing perevir for that. It's work in progress, but it's already serving me well.