-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.lua
76 lines (61 loc) · 1.09 KB
/
main.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
72
73
74
75
76
local ic = require("src.icecream")
local function testPosition()
local x = 1
local y = 1
ic(x,y)
ic:SetIsOutPutPosition(true)
ic(x,y)
ic:SetIsOutPutPosition(false)
end
local function testPrefix()
local x = 1
ic(x)
ic:SetPrefix('arst')
ic(x)
ic:ResetPrefix()
ic(x)
end
local function testIC()
local x = 1
local y = 2
ic(x,y)
end
local function testNoName()
ic(1,2)
end
local function testNoArg()
ic()
end
local function testFunc()
local a1 = 11
local function func(a)
return a + 23
end
ic(func(a1))
end
local function testDisable()
local noPrint = "no print"
ic:Disable()
ic(noPrint)
end
local function testEnable()
local yesPrint = "yes print"
ic:Enable()
ic(yesPrint)
end
print('---- test ic')
testIC()
print('---- test prefix')
testPrefix()
print('---- test positoin')
testPosition()
print('---- test no name')
testNoName()
print('---- test no args')
testNoArg()
print('---- test function')
testFunc()
print('---- test disable')
testDisable()
print('---- test enable')
testEnable()