summaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2018-02-24 21:59:50 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2018-02-24 22:43:28 +0100
commitb5bd8a9461dc317ff61abec68feba4a86d39e9f2 (patch)
treea22e940d299d0fb8741d7347ea4be69b3c6c48e9 /test/Tests
parent39dd7c794bc881acd2030c07ddfb7b34842f19a3 (diff)
Lua: register script name in global variable
The name of the Lua script which is executed is made available in the global Lua variable `PANDOC_SCRIPT_FILE`, both for Lua filters and custom writers. Closes: #4393
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Lua.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs
index b25a6fa4a..b42fda9c8 100644
--- a/test/Tests/Lua.hs
+++ b/test/Tests/Lua.hs
@@ -111,6 +111,12 @@ tests = map (localOption (QuickCheckTests 20))
, plain (str "to_roman_numeral: OK")
])
+ , testCase "Script filename is set" $
+ assertFilterConversion "unexpected script name"
+ "script-name.lua"
+ (doc $ para "ignored")
+ (doc $ para "lua/script-name.lua")
+
, testCase "Pandoc version is set" . runPandocLua' $ do
Lua.getglobal' "table.concat"
Lua.getglobal "PANDOC_VERSION"