mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Fixed negation issue, moved some scripts to test/
This commit is contained in:
15
test/arithmetic.toy
Normal file
15
test/arithmetic.toy
Normal file
@@ -0,0 +1,15 @@
|
||||
//test operators (integers)
|
||||
assert 1 + 1 == 2, "1 + 1 == 2";
|
||||
assert 1 - 1 == 0, "1 - 1 == 0";
|
||||
assert 2 * 2 == 4, "2 * 2 == 4";
|
||||
assert 1 / 2 == 0, "1 / 2 == 0"; //integer division
|
||||
assert 5 % 2 == 1, "5 % 2 == 1";
|
||||
|
||||
//test operators (floats)
|
||||
assert 1.0 + 1.0 == 2.0, "1.0 + 1.0 == 2.0";
|
||||
assert 1.0 - 1.0 == 0.0, "1.0 - 1.0 == 0.0";
|
||||
assert 2.0 * 2.0 == 4.0, "2.0 * 2.0 == 4.0";
|
||||
assert 1.0 / 2.0 == 0.5, "1.0 / 2.0 == 0.5";
|
||||
|
||||
|
||||
print "All good";
|
||||
Reference in New Issue
Block a user