mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Fixed a post-fix increment issue, highlighted in the game engine
This commit is contained in:
15
test/scripts/increment-postfix-bugfix.toy
Normal file
15
test/scripts/increment-postfix-bugfix.toy
Normal file
@@ -0,0 +1,15 @@
|
||||
var a = 0;
|
||||
|
||||
if (a++ >= 1) {
|
||||
assert false, "increment postfix bugfix failed (first check)";
|
||||
}
|
||||
|
||||
|
||||
if (a++ >= 1) {
|
||||
|
||||
}
|
||||
|
||||
assert a == 2, "increment postfix bugfix failed (second check)";
|
||||
|
||||
|
||||
print "All good";
|
||||
Reference in New Issue
Block a user