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
|
local lu = require('luaunit')
--[[ Test used by functional tests ]]
TestSomething = {} --class
function TestSomething:test1_Success1()
lu.assertEquals( 1+1, 2 )
end
function TestSomething:test1_Success2()
lu.assertEquals( 1+2, 3 )
end
function TestSomething:test2_Fail1()
lu.assertEquals( 1+1, 0 )
end
function TestSomething:test2_Fail2()
lu.assertEquals( 1+2, 0 )
end
function TestSomething:test3_Err1()
local v = 1 + { 1,2 }
end
function TestSomething:test3_Err2()
local v = 1 + { 1,2 }
end
TestAnotherThing = {} --class
function TestAnotherThing:test1_Success1()
lu.assertEquals( 1+1, 2 )
end
function TestAnotherThing:test1_Success2()
lu.assertEquals( 1+2, 3 )
end
function TestAnotherThing:test2_Err1()
local v = 1 + { 1,2 }
end
function TestAnotherThing:test2_Err2()
local v = 1 + { 1,2 }
end
function TestAnotherThing:test3_Fail1()
lu.assertEquals( 1+1, 0 )
end
function TestAnotherThing:test3_Fail2()
lu.assertEquals( 1+2, 0 )
end
function testFuncSuccess1()
lu.assertEquals( 1+1, 2 )
end
function testFuncFail1()
lu.assertEquals( 1+2, 0 )
end
function testFuncErr1()
local v = 1 + { 1,2 }
end
local runner = lu.LuaUnit.new()
runner:setOutputType("text")
os.exit( runner:runSuite() )
|