aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/command/lua-pandoc-state.lua11
-rw-r--r--test/command/lua-pandoc-state.md14
2 files changed, 25 insertions, 0 deletions
diff --git a/test/command/lua-pandoc-state.lua b/test/command/lua-pandoc-state.lua
new file mode 100644
index 000000000..5282a4c29
--- /dev/null
+++ b/test/command/lua-pandoc-state.lua
@@ -0,0 +1,11 @@
+function report (what, value)
+ print(string.format('%16s: %s', what, value))
+end
+report('# input files', #PANDOC_STATE.input_files)
+report('output file', PANDOC_STATE.output_file)
+report('# request header', #PANDOC_STATE.request_headers)
+report('resource path', table.concat(PANDOC_STATE.resource_path, ', '))
+report('source URL', PANDOC_STATE.source_url)
+report('user data dir', PANDOC_STATE.user_data_dir and 'defined' or 'unset')
+report('trace', PANDOC_STATE.trace)
+report('verbosity', PANDOC_STATE.verbosity)
diff --git a/test/command/lua-pandoc-state.md b/test/command/lua-pandoc-state.md
new file mode 100644
index 000000000..33045f64a
--- /dev/null
+++ b/test/command/lua-pandoc-state.md
@@ -0,0 +1,14 @@
+```
+% pandoc --lua-filter=command/lua-pandoc-state.lua
+Hello
+^D
+ # input files: 0
+ output file: nil
+# request header: 0
+ resource path: .
+ source URL: nil
+ user data dir: defined
+ trace: false
+ verbosity: WARNING
+<p>Hello</p>
+```