diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-29 17:13:19 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-29 17:13:19 +0200 |
commit | 5e00cf8086e0960e81c31f7cd981ace646623f09 (patch) | |
tree | a2cffda0c28e112169bcdd4056098a4ee8d40299 /test | |
parent | 0f658eb46ce3630886b733e8c8ed1086af9b3510 (diff) | |
download | pandoc-5e00cf8086e0960e81c31f7cd981ace646623f09.tar.gz |
Added parameter for user data directory to runLuaFilter.
in Text.Pandoc.Lua. Also to pushPandocModule.
This change allows users to override pandoc.lua with a file
in their local data directory, adding custom functions, etc.
@tarleb, if you think this is a bad idea, you can revert this.
But in general our data files are all overridable.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Lua.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index cd8604ab9..ebd39366b 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -68,7 +68,7 @@ tests = map (localOption (QuickCheckTests 20)) assertFilterConversion :: String -> FilePath -> Pandoc -> Pandoc -> Assertion assertFilterConversion msg filterPath docIn docExpected = do - docRes <- runLuaFilter ("lua" </> filterPath) [] docIn + docRes <- runLuaFilter Nothing ("lua" </> filterPath) [] docIn assertEqual msg docExpected docRes roundtripEqual :: (Eq a, Lua.StackValue a) => a -> IO Bool @@ -78,7 +78,7 @@ roundtripEqual x = (x ==) <$> roundtripped roundtripped = do lua <- Lua.newstate Lua.openlibs lua - pushPandocModule lua + pushPandocModule Nothing lua Lua.setglobal lua "pandoc" oldSize <- Lua.gettop lua Lua.push lua x |