From 9c76c52e9bb1481234b8ee5ef9c524a5a61d43bd Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 12 May 2020 17:10:30 +0200 Subject: Lua: fix regression in package searcher This caused `require 'module'` to fail for third party packages. Fixes: #6361 --- test/Tests/Lua.hs | 6 ++++++ test/lua/require-file.lua | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 test/lua/require-file.lua (limited to 'test') diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 14800f7bb..bf9ddc2d5 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -172,6 +172,12 @@ tests = map (localOption (QuickCheckTests 20)) Lua.liftIO . assertEqual "pandoc-types version is wrong" pandocTypesVersion =<< Lua.peek Lua.stackTop + , testCase "require file" $ + assertFilterConversion "requiring file failed" + "require-file.lua" + (doc $ para "ignored") + (doc $ para (str . T.pack $ "lua" "require-file.lua")) + , testCase "Allow singleton inline in constructors" . runLuaTest $ do Lua.liftIO . assertEqual "Not the exptected Emph" (Emph [Str "test"]) =<< Lua.callFunc "pandoc.Emph" (Str "test") diff --git a/test/lua/require-file.lua b/test/lua/require-file.lua new file mode 100644 index 000000000..d610e5266 --- /dev/null +++ b/test/lua/require-file.lua @@ -0,0 +1,2 @@ +package.path = package.path .. ';lua/?.lua' +require 'script-name' -- cgit v1.2.3