summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-06-03 17:03:26 +0200
committerHaru <haru@dotalux.com>2017-06-03 17:03:26 +0200
commit392c4b225dfc99401faeef882b10ce0b6d6a2209 (patch)
treeaccb8fd1da1be25644e39e18c4e0171420120fb1
parent919a95860a57a19903dc900900477062a8be193e (diff)
downloadhercules-392c4b225dfc99401faeef882b10ce0b6d6a2209.tar.gz
hercules-392c4b225dfc99401faeef882b10ce0b6d6a2209.tar.bz2
hercules-392c4b225dfc99401faeef882b10ce0b6d6a2209.tar.xz
hercules-392c4b225dfc99401faeef882b10ce0b6d6a2209.zip
Add tests for the exponentiation operator
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--npc/dev/test.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index b711a0a28..b35beb8ed 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -268,6 +268,19 @@ function script HerculesSelfTestHelper {
callsub(OnCheck, "Order of + and *", .@x, 7);
+ // Binary ** operator
+ .@x = 2 ** 3; // .@x = 8;
+ callsub(OnCheck, "Binary ** operator", .@x, 8);
+
+ // Associativity of **
+ .@x = 2 ** 3 ** 2; // .@x = (2 ** 3) ** 2;
+ callsub(OnCheck, "Associativity of **", .@x, 64);
+
+ // Order of ** and *
+ .@x = 5 * 2 ** 3 * 2; // .@x = 5 * (2 ** 3) * 2;
+ callsub(OnCheck, "Order of ** and *", .@x, 80);
+
+
// << and >> operators
.@x = 1<<3; // .@x = 1*2*2*2;
callsub(OnCheck, "Left shift << operator", .@x, 8);