git.iko.soy/typeable/pandoc
on 46baf66 help sign in
typeable/pandoc/test/lua/module/pandoc-path.lua
44 lines 1.1 kB history raw
1local tasty = require 'tasty'
2local path = require 'pandoc.path'
4local assert = tasty.assert
5local test = tasty.test_case
6local group = tasty.test_group
8return {
9 group 'path separator' {
10 test('is string', function ()
11 assert.are_same(type(path.separator), 'string')
12 end),
13 test('is slash or backslash', function ()
14 assert.is_truthy(path.separator:match '^[/\\]$')
15 end),
16 },
17 group 'search path separator' {
18 test('is string', function ()
19 assert.are_same(type(path.search_path_separator), 'string')
20 end),
21 test('is colon or semicolon', function ()
22 assert.is_truthy(path.search_path_separator:match '^[:;]$')
23 end)
24 },
25 group 'module' {
26 test('check function existence', function ()
27 local functions = {
28 'directory',
29 'filename',
30 'is_absolute',
31 'is_relative',
32 'join',
33 'make_relative',
34 'normalize',
35 'split',
36 'split_extension',
37 'split_search_path',
38 }
39 for _, f in ipairs(functions) do
40 assert.are_equal(type(path[f]), 'function')
41 end
42 end)
43 }