git.iko.soy/typeable/pandoc
on master help sign in
More adjustments to test-pandoc-utils.lua.
9f2af30John MacFarlane
test/lua/test-pandoc-utils.lua+4−5
@@ -38,7 +38,7 @@ end
38
38
39function test_pipe ()
39function test_pipe ()
40 if os_is_windows() then
40 if os_is_windows() then
41− local pipe_result = pandoc.pipe('echo', {}, 'hi')
41+ local pipe_result = pandoc.pipe('find', {'hi'}, 'hi')
42 return pipe_result == 'hi\n' or pipe_result == 'hi'
42 return pipe_result == 'hi\n' or pipe_result == 'hi'
43 else
43 else
44 local pipe_result = pandoc.pipe('tr', {'a', 'b'}, 'abc')
44 local pipe_result = pandoc.pipe('tr', {'a', 'b'}, 'abc')
@@ -48,11 +48,10 @@ end
48
48
49function test_failing_pipe ()
49function test_failing_pipe ()
50 if os_is_windows() then
50 if os_is_windows() then
51− local res, err = pcall(pandoc.pipe, 'cd', {}, 'NoNExistEnt')
51+ local res, err = pcall(pandoc.pipe, 'find', {'/a'}, 'hi')
52 return not res and
52 return not res and
53− err.command == 'cd' and
53+ err.command == 'find' and
54− err.error_code == 1 and
54+ err.error_code ~= 0
55− err.output == ''
56 else
55 else
57 local res, err = pcall(pandoc.pipe, 'false', {}, 'abc')
56 local res, err = pcall(pandoc.pipe, 'false', {}, 'abc')
58 return not res and
57 return not res and