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.txt18
1 files changed, 17 insertions, 1 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index 036a94916..2822ee65c 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -651,6 +651,12 @@ function script HerculesSelfTestHelper {
setd(".@x", getd(".@y"));
callsub(OnCheck, "setd getd", .@x, .@y);
+ // getd types
+ callsub(OnCheck, "Getdatatype (getd: param)", getdatatype(getd("Hp")), DATATYPE_INT | DATATYPE_PARAM);
+ callsub(OnCheck, "Getdatatype (getd: const)", getdatatype(getd("DATATYPE_CONST")), DATATYPE_INT | DATATYPE_CONST);
+ callsub(OnCheck, "Getdatatype (getd: numeric var)", getdatatype(getd(".@foo")), DATATYPE_INT | DATATYPE_VAR);
+ callsub(OnCheck, "Getdatatype (getd: string var)", getdatatype(getd(".@foo$")), DATATYPE_STR | DATATYPE_VAR);
+
// getvariableofnpc
.x = 2;
set getvariableofnpc(.x, "TestVarOfAnotherNPC"), 1;
@@ -762,13 +768,23 @@ function script HerculesSelfTestHelper {
callsub(OnCheck, "Getdatatype (numeric variable)", getdatatype(.@x), DATATYPE_INT | DATATYPE_VAR);
callsub(OnCheck, "Getdatatype (string variable)", getdatatype(.@x$), DATATYPE_STR | DATATYPE_VAR);
callsub(OnCheck, "Getdatatype (label)", getdatatype(OnTestGetdatatype), DATATYPE_LABEL);
- //callsub(OnCheck, "Getdatatype (constant)", getdatatype(DATATYPE_CONST), DATATYPE_CONST); // FIXME
+ callsub(OnCheck, "Getdatatype (constant)", getdatatype(DATATYPE_CONST), DATATYPE_INT | DATATYPE_CONST);
callsub(OnCheck, "Getdatatype (returned integer)", getdatatype(callsub(OnTestReturnValue, 5)), DATATYPE_INT);
callsub(OnCheck, "Getdatatype (returned string)", getdatatype(callsub(OnTestReturnValue, "foo")), DATATYPE_STR | DATATYPE_CONST);
callsub(OnCheck, "Getdatatype (getarg default value)", callsub(OnTestGetdatatypeDefault), DATATYPE_INT);
callsub(OnCheck, "Getdatatype (getarg integer value)", callsub(OnTestGetdatatype, 5), DATATYPE_INT);
callsub(OnCheck, "Getdatatype (getarg string)", callsub(OnTestGetdatatype, "foo"), DATATYPE_STR | DATATYPE_CONST);
+ callsub(OnCheck, "data_to_string (NIL)", data_to_string(), "");
+ callsub(OnCheck, "data_to_string (empty string)", data_to_string(""), "");
+ callsub(OnCheck, "data_to_string (string)", data_to_string("foo"), "foo");
+ callsub(OnCheck, "data_to_string (integer)", data_to_string(5), "5");
+ callsub(OnCheck, "data_to_string (parameter)", data_to_string(Hp), "Hp");
+ callsub(OnCheck, "data_to_string (constant)", data_to_string(DATATYPE_CONST), "DATATYPE_CONST");
+ callsub(OnCheck, "data_to_string (label)", data_to_string(OnTestGetdatatype), "OnTestGetdatatype");
+ callsub(OnCheck, "data_to_string (string variable)", data_to_string(.@x$), ".@x$");
+ callsub(OnCheck, "data_to_string (integer variable)", data_to_string(.@x), ".@x");
+
if (.errors) {
debugmes "Script engine self-test [ \033[0;31mFAILED\033[0m ]";
debugmes "**** The test was completed with " + .errors + " errors. ****";