aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2024-06-08 14:39:58 +0200
committerAlbert Krewinkel <[email protected]>2024-06-08 14:39:58 +0200
commit6a88abae3d8ceb4463da423e934cc03e6e5ce5fa (patch)
tree4f73254b6a870f1a42de7191110f7c10380a54ca /pandoc-lua-engine/test
parentd50bd30324ef9e8053d750ff0139e7d9bff1d912 (diff)
Lua: keep CommonState object in the registry
The state is an internal value and should be treated as such. The `PANDOC_STATE` global is merely a copy; unsetting the global no longer breaks the Lua engine.
Diffstat (limited to 'pandoc-lua-engine/test')
-rw-r--r--pandoc-lua-engine/test/lua/module/globals.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/pandoc-lua-engine/test/lua/module/globals.lua b/pandoc-lua-engine/test/lua/module/globals.lua
index 52ef226bc..4df133e46 100644
--- a/pandoc-lua-engine/test/lua/module/globals.lua
+++ b/pandoc-lua-engine/test/lua/module/globals.lua
@@ -147,5 +147,11 @@ return {
test('has property "verbosity"', function ()
assert.are_equal(type(PANDOC_STATE.verbosity), 'string')
end),
+ test('can be deleted without breaking PandocLua monad functions', function()
+ local state = PANDOC_STATE
+ PANDOC_STATE = nil
+ assert.is_nil(pandoc.mediabag.lookup('does-not-exist'))
+ PANDOC_STATE = state
+ end),
},
}