From 392c4b225dfc99401faeef882b10ce0b6d6a2209 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 3 Jun 2017 17:03:26 +0200 Subject: Add tests for the exponentiation operator Signed-off-by: Haru --- npc/dev/test.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); -- cgit v1.2.3-70-g09d2