diff options
| author | Albert Krewinkel <[email protected]> | 2026-01-05 22:46:32 +0100 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2026-01-05 22:48:45 +0100 |
| commit | e9c4d7f7246d0312e7b7613c8aa1b15c4559826f (patch) | |
| tree | fcf279014d55b36fce6e796ce79e9e776060886b /pandoc-lua-engine/test/lua/module | |
| parent | 2a426718bc7c6cc88ceac0359b60f840d0f27bf9 (diff) | |
Lua: let `pandoc.with_state` error on unknown options
Unknown or unsupported options now cause the `pandoc.with_state`
function to fail.
Closes: #11376
Diffstat (limited to 'pandoc-lua-engine/test/lua/module')
| -rw-r--r-- | pandoc-lua-engine/test/lua/module/pandoc.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pandoc-lua-engine/test/lua/module/pandoc.lua b/pandoc-lua-engine/test/lua/module/pandoc.lua index 1bb364f54..f9c58f5aa 100644 --- a/pandoc-lua-engine/test/lua/module/pandoc.lua +++ b/pandoc-lua-engine/test/lua/module/pandoc.lua @@ -490,12 +490,17 @@ return { pandoc.with_state(opts, function () end) assert.are_equal(PANDOC_STATE.user_data_dir, orig_user_data_dir) end), - test('unsupported options are ignored', function () + test('unsupported options trigger an error', function () local orig_log = PANDOC_STATE.log local opts = {log = 'nonsense'} - pandoc.with_state(opts, function () - assert.are_same(PANDOC_STATE.log, orig_log) - end) + assert.error_matches( + function () + pandoc.with_state(opts, function () + assert.are_same(PANDOC_STATE.log, orig_log) + end) + end, + "Unknown or unsupported" + ) assert.are_same(PANDOC_STATE.log, orig_log) end), }, |
