summaryrefslogtreecommitdiff
path: root/npc/dev
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-10-22 15:26:36 -0400
committergumi <git@gumi.ca>2018-10-22 15:26:36 -0400
commit5219e2e3d004e52a8a08cb96536e30ced7001b95 (patch)
treec6cc21390b7fd45a1a70e3da6981dbc7ae4e7cdb /npc/dev
parent6d6ac01e3cfb54dffed86ecce0f39a92931c3c66 (diff)
downloadhercules-5219e2e3d004e52a8a08cb96536e30ced7001b95.tar.gz
hercules-5219e2e3d004e52a8a08cb96536e30ced7001b95.tar.bz2
hercules-5219e2e3d004e52a8a08cb96536e30ced7001b95.tar.xz
hercules-5219e2e3d004e52a8a08cb96536e30ced7001b95.zip
add unit tests for data_to_string
Diffstat (limited to 'npc/dev')
-rw-r--r--npc/dev/test.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index c2f07ab2f..2822ee65c 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -775,6 +775,16 @@ function script HerculesSelfTestHelper {
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. ****";