-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlusp_test.lua
73 lines (57 loc) · 1.4 KB
/
lusp_test.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require('luarocks.require')
require('telescope')
require('lusp')
context('Lusp', function()
context('atom(token)', function()
test('Returns "number" for numbers', function()
assert_type(atom('666'), 'number')
end)
test('Returns "string" for others', function()
assert_type(atom('text'), 'string')
end)
end)
context('env:find(var)', function()
test('')
end)
context('read_from(tokens)', function()
test('')
end)
context('isa(o, t)', function()
test('')
end)
context('eval(x)', function()
test('')
end)
context('map(f, t)', function()
test('')
end)
context('pop(t)', function()
test('')
end)
context('tokenize(s)', function()
test('(10) has three tokens: "(", "10" and ")"', function()
local tokens = tokenize('(10)')
assert_equal(3, #tokens)
assert_equal('(', tokens[1])
assert_equal('10', tokens[2])
assert_equal(')', tokens[3])
end)
test('(10 11) has four tokens: "(", "10" "11" and ")"', function()
local tokens = tokenize('(10 11)')
assert_equal(4, #tokens)
assert_equal('(', tokens[1])
assert_equal('10', tokens[2])
assert_equal('11', tokens[3])
assert_equal(')', tokens[4])
end)
end)
context('read(s)', function()
test('')
end)
context('parse', function()
test('')
end)
context('to_string(exp)', function()
test('')
end)
end)