mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Gonna start unit testing to resolve issues
This commit is contained in:
27
scripts/test/comparisons.toy
Normal file
27
scripts/test/comparisons.toy
Normal file
@@ -0,0 +1,27 @@
|
||||
//test numbers
|
||||
assert 1 < 2, "1 < 2";
|
||||
assert 1 == 1, "1 == 1";
|
||||
assert 2 > 1, "2 > 1";
|
||||
assert 1 <= 2, "1 <= 2";
|
||||
assert 2 >= 1, "2 >= 1";
|
||||
|
||||
|
||||
//test variables
|
||||
var a = 1;
|
||||
var b = 2;
|
||||
|
||||
assert a < b, "a < b";
|
||||
assert a == a, "a == a";
|
||||
assert b > a, "b > a";
|
||||
assert a <= b, "a <= b";
|
||||
assert b >= a, "b >= a";
|
||||
|
||||
|
||||
//test negation
|
||||
assert !false, "!false";
|
||||
|
||||
var c = false;
|
||||
assert !c, "!c";
|
||||
|
||||
|
||||
print "All good";
|
||||
Reference in New Issue
Block a user