summaryrefslogtreecommitdiff
path: root/Data/Libraries/luaunit/test/test_with_err_fail_pass.lua
diff options
context:
space:
mode:
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.lua71
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() )