diff options
author | Haru <haru@dotalux.com> | 2018-06-25 20:56:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 20:56:54 +0200 |
commit | c419726752ebd1b532f487e5683f63232a6c237b (patch) | |
tree | 81e1220c7f857f7fb31dc278f15f1cb6216b5205 /npc | |
parent | f9eb9bd870314a18165349232edef25ae8057e24 (diff) | |
parent | 4146cf9207e2270359dce726aaa8214b2c9cce7a (diff) | |
download | hercules-c419726752ebd1b532f487e5683f63232a6c237b.tar.gz hercules-c419726752ebd1b532f487e5683f63232a6c237b.tar.bz2 hercules-c419726752ebd1b532f487e5683f63232a6c237b.tar.xz hercules-c419726752ebd1b532f487e5683f63232a6c237b.zip |
Merge pull request #2077 from AnnieRuru/39-pre-increment
Fix pre-increment / pre-decrement operator error
Diffstat (limited to 'npc')
-rw-r--r-- | npc/dev/test.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt index a6f89f857..036a94916 100644 --- a/npc/dev/test.txt +++ b/npc/dev/test.txt @@ -150,6 +150,20 @@ function script HerculesSelfTestHelper { callsub(OnCheck, "Prefix decrement --", .@y); callsub(OnCheck, "Prefix decrement --", .@x); + // Increment and decrement operators after a condition + .@x = 0; + if (1) .@x++; + callsub(OnCheck, "Suffix increment ++ after (condition)", .@x); + .@x = 2; + if (1) .@x--; + callsub(OnCheck, "Suffix decrement -- after (condition)", .@x); + .@x = 0; + if (1) ++.@x; + callsub(OnCheck, "Prefix increment ++ after (condition)", .@x); + .@x = 2; + if (1) --.@x; + callsub(OnCheck, "Prefix decrement -- after (condition)", .@x); + // Order of [] and --/++ .@a[1] = 0; .@a[1]++; // .@a[1] = .@a[1] + 1; |