aboutsummaryrefslogtreecommitdiff
path: root/test/lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-03-25 22:16:27 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2020-04-17 21:52:48 +0200
commitfb54f3d6792d2f8e7b05e458b59142f8ae6bb3e2 (patch)
treeb5403849735559bd28050fe8bccf068bdf37f48a /test/lua
parent2877ca70ecaf5b6715b38f41165974f89206d18b (diff)
downloadpandoc-fb54f3d6792d2f8e7b05e458b59142f8ae6bb3e2.tar.gz
API change: use PandocError for exceptions in Lua subsystem
The PandocError type is used throughout the Lua subsystem, all Lua functions throw an exception of this type if an error occurs. The `LuaException` type is removed and no longer exported from `Text.Pandoc.Lua`. In its place, a new constructor `PandocLuaError` is added to PandocError.
Diffstat (limited to 'test/lua')
-rw-r--r--test/lua/module/pandoc-types.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/lua/module/pandoc-types.lua b/test/lua/module/pandoc-types.lua
index 880dd567e..d4e063a5c 100644
--- a/test/lua/module/pandoc-types.lua
+++ b/test/lua/module/pandoc-types.lua
@@ -26,10 +26,9 @@ return {
)
end),
test('non-version string is rejected', function ()
- assert.error_matches(
- function () Version '11friends' end,
- '11friends'
- )
+ local success, msg = pcall(function () Version '11friends' end)
+ assert.is_falsy(success)
+ assert.is_truthy(tostring(msg):match('11friends'))
end)
},