@@ -1,4 +1,4 @@
1−utils = require 'pandoc'
1+utils = require 'pandoc.utils'
4------------------------------------------------------------------------
4------------------------------------------------------------------------
@@ -22,7 +22,7 @@ function test_pipe ()
22 warn 'Did not find /bin/sed, skipping test'
22 warn 'Did not find /bin/sed, skipping test'
23 return true
23 return true
25− local pipe_result = utils.pipe('/bin/sed', {'-e', 's/a/b/'}, 'abc')
25+ local pipe_result = pandoc.pipe('/bin/sed', {'-e', 's/a/b/'}, 'abc')
26 return pipe_result == 'bbc'
26 return pipe_result == 'bbc'
@@ -31,7 +31,7 @@ function test_failing_pipe ()
31 warn 'Did not find /bin/false, skipping test'
31 warn 'Did not find /bin/false, skipping test'
32 return true
32 return true
34− local res, err = pcall(utils.pipe, '/bin/false', {}, 'abc')
34+ local res, err = pcall(pandoc.pipe, '/bin/false', {}, 'abc')
35 return not res and
35 return not res and
36 err.command == '/bin/false' and
36 err.command == '/bin/false' and
37 err.error_code == 1 and
37 err.error_code == 1 and
@@ -51,6 +51,18 @@ function test_failing_read ()
51 return not res and err:match 'Unknown reader: nosuchreader'
51 return not res and err:match 'Unknown reader: nosuchreader'
55+------------------------------------------------------------------------
56+function test_stringify ()
57+ local inline = pandoc.Emph{
64+ return utils.stringify(inline) == 'Cogito ergo sum.'
55-- Return result
67-- Return result
56------------------------------------------------------------------------
68------------------------------------------------------------------------
@@ -65,5 +77,6 @@ function Para (el)
65 pandoc.Plain{pandoc.Str("failing pipe: " .. run(test_failing_pipe))},
77 pandoc.Plain{pandoc.Str("failing pipe: " .. run(test_failing_pipe))},
66 pandoc.Plain{pandoc.Str("read: " .. run(test_read))},
78 pandoc.Plain{pandoc.Str("read: " .. run(test_read))},
67 pandoc.Plain{pandoc.Str("failing read: " .. run(test_failing_read))},
79 pandoc.Plain{pandoc.Str("failing read: " .. run(test_failing_read))},
80+ pandoc.Plain{pandoc.Str("stringify: " .. run(test_stringify))},