1local tasty = require 'tasty'
3local test = tasty.test_case
4local group = tasty.test_group
5local assert = tasty.assert
7function os_is_windows ()
8 return package.config:sub(1,1) == '\\'
13 test('external string processing', function ()
14 if os_is_windows() then
15 local pipe_result = pandoc.pipe('find', {'hi'}, 'hi')
16 assert.are_equal('hi', pipe_result:match '%a+')
18 local pipe_result = pandoc.pipe('tr', {'a', 'b'}, 'abc')
19 assert.are_equal('bbc', pipe_result:match '%a+')
22 test('failing pipe', function ()
23 if os_is_windows() then
24 local success, err = pcall(pandoc.pipe, 'find', {'/a'}, 'hi')
25 assert.is_falsy(success)
26 assert.are_equal('find', err.command)
27 assert.is_truthy(err.error_code ~= 0)
29 local success, err = pcall(pandoc.pipe, 'false', {}, 'abc')
30 assert.is_falsy(success)
31 assert.are_equal('false', err.command)
32 assert.are_equal(1, err.error_code)
33 assert.are_equal('', err.output)
39 test('Markdown', function ()
40 local valid_markdown = '*Hello*, World!\n'
41 local expected = pandoc.Pandoc({
43 pandoc.Emph { pandoc.Str 'Hello' },
49 assert.are_same(expected, pandoc.read(valid_markdown))
51 test('failing read', function ()
53 function () pandoc.read('foo', 'nosuchreader') end,
54 'Unknown reader: nosuchreader'
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list