mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Found a compiler bug, thanks Aedan!
This commit is contained in:
23
test/scripts/dot-modulo-bugfix.toy
Normal file
23
test/scripts/dot-modulo-bugfix.toy
Normal file
@@ -0,0 +1,23 @@
|
||||
var days = [
|
||||
"sunday",
|
||||
"monday",
|
||||
"tuesday",
|
||||
"wednesday",
|
||||
"thursday",
|
||||
"friday",
|
||||
"saturday"
|
||||
];
|
||||
|
||||
var rng = 10; //for chosen at random
|
||||
|
||||
|
||||
var index = rng % days.length();
|
||||
|
||||
assert index == 3, "dot modulo bugfix failed";
|
||||
|
||||
rng %= days.length();
|
||||
|
||||
assert rng == 3, "dot modulo assign bugfix failed";
|
||||
|
||||
|
||||
print "All good";
|
||||
@@ -114,6 +114,7 @@ int main() {
|
||||
"dot-and-matrix.toy",
|
||||
"dot-assignments-bugfix.toy",
|
||||
"dot-chaining.toy",
|
||||
"dot-modulo-bugfix.toy",
|
||||
"dottify-bugfix.toy",
|
||||
"functions.toy",
|
||||
"index-arrays.toy",
|
||||
|
||||
Reference in New Issue
Block a user