New (passing) test, arithmetic.lua

Sun, 21 Nov 2010 21:36:26 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 21 Nov 2010 21:36:26 +0000
changeset 111
cb1ef8a51da4
parent 110
6a6e5ef39eaf
child 112
5318bb31b0ac

New (passing) test, arithmetic.lua

tests/pass/arithmetic.lua file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/pass/arithmetic.lua	Sun Nov 21 21:36:26 2010 +0000
@@ -0,0 +1,21 @@
+local _ = 0; -- To prevent constant folding
+assert((_ + 0) + 0 == 0)
+assert((_ + 0) + 1 == 1)
+assert((_ + 1) + 0 == 1)
+assert((_ + 1) + 1 == 2)
+
+assert((_ + 0) - 0 == 0)
+assert((_ + 0) - 1 == -1)
+assert((_ + 0) - 0 == 0)
+assert((_ + 1) - 1 == 0)
+
+assert((_ + 0) * 0 == 0)
+assert((_ + 0) * 1 == 0)
+assert((_ + 1) * 0 == 0)
+assert((_ + 1) * 1 == 1)
+
+assert((0 / 1) == 0)
+assert((1 / 1) == 1)
+assert((1 / 2) == 0.5)
+assert((2 / 1) == 2)
+

mercurial