diff options
author | chai <chaifix@163.com> | 2021-10-26 11:32:46 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-26 11:32:46 +0800 |
commit | 0549b1e5a8a3132005e275d6026db8003cb067d2 (patch) | |
tree | f0d7751ec32ecf5c4d23997fa0ffd3450a5a755a /Data/Libraries/luaunit/test/test_with_err_fail_pass.lua | |
parent | 32345800737b668011a87328cd3dcce59ec2934c (diff) |
*rename folder
Diffstat (limited to 'Data/Libraries/luaunit/test/test_with_err_fail_pass.lua')
-rw-r--r-- | Data/Libraries/luaunit/test/test_with_err_fail_pass.lua | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/Data/Libraries/luaunit/test/test_with_err_fail_pass.lua b/Data/Libraries/luaunit/test/test_with_err_fail_pass.lua new file mode 100644 index 0000000..b137529 --- /dev/null +++ b/Data/Libraries/luaunit/test/test_with_err_fail_pass.lua @@ -0,0 +1,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() ) |