summaryrefslogtreecommitdiff
path: root/npc/dev/test.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/dev/test.txt')
-rw-r--r--npc/dev/test.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index 8e94d6ee7..9c2de9a55 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -611,6 +611,10 @@ function script HerculesSelfTestHelper {
callsub(OnCheck, "Callsub (parent scope vars isolation)", .@x, 1);
callsub(OnCheck, "Callsub (nested scopes)", callsub(OnTestNestedScope), 1);
callsub(OnCheck, "Callsub (deeply nested scopes)", callsub(OnTestDeepNestedScope, 30, 0), 1);
+ .@x = 1;
+ .@y = callsub(OnSetReference, .@x);
+ callsub(OnCheck, "Callsub (setting references)", .@y, 2);
+ callsub(OnCheck, "Callsub (setting references)", .@x, 2);
deletearray .@x;
setarray .@x, 1, 2, 3, 4;
callsub(OnCheck, "Callsub (array references)", callsub(OnTestArrayRefs, .@x), 4);
@@ -750,6 +754,9 @@ OnCheckStr:
callsub(OnReportError, .@msg$, .@val$, .@ref$);
}
return;
+OnSetReference:
+ set getarg(0), getarg(0) + 1;
+ return getarg(0);
}
- script HerculesSelfTest -1,{