diff options
author | Haru <haru@dotalux.com> | 2017-07-11 11:52:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-11 11:52:06 +0200 |
commit | 9e9ef5d1f8265fc31128f557d3a6b520baa5e133 (patch) | |
tree | a1382e88c3c2f28bbd1c246ff16937c9a354ae38 /npc/dev/test.txt | |
parent | 94990c64c300c9b72509ec3cc9082538ef7105bf (diff) | |
parent | 2623a35e451a463f4be14638b37bc294d08094a1 (diff) | |
download | hercules-9e9ef5d1f8265fc31128f557d3a6b520baa5e133.tar.gz hercules-9e9ef5d1f8265fc31128f557d3a6b520baa5e133.tar.bz2 hercules-9e9ef5d1f8265fc31128f557d3a6b520baa5e133.tar.xz hercules-9e9ef5d1f8265fc31128f557d3a6b520baa5e133.zip |
Merge pull request #1788 from mekolat/type2
new buildin: getdatatype()
Diffstat (limited to 'npc/dev/test.txt')
-rw-r--r-- | npc/dev/test.txt | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt index b35beb8ed..a6f89f857 100644 --- a/npc/dev/test.txt +++ b/npc/dev/test.txt @@ -9,8 +9,8 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2013-2015 Hercules Dev Team -//= Copyright (C) 2013-2015 Haru +//= Copyright (C) 2013-2017 Hercules Dev Team +//= Copyright (C) 2013-2017 Haru //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -742,6 +742,19 @@ function script HerculesSelfTestHelper { callsub(OnCheckStr, "sprintf (positional)", sprintf("'%2$+05d'", 5, 6), "'+0006'"); callsub(OnCheckStr, "sprintf (positional)", sprintf("'%2$s' '%1$c'", "First", "Second"), "'Second' 'F'"); + callsub(OnCheck, "Getdatatype (integer)", getdatatype(5), DATATYPE_INT); + callsub(OnCheck, "Getdatatype (constant string)", getdatatype("foo"), DATATYPE_STR | DATATYPE_CONST); + callsub(OnCheck, "Getdatatype (parameter)", getdatatype(Hp), DATATYPE_INT | DATATYPE_PARAM); + 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 (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); + if (.errors) { debugmes "Script engine self-test [ \033[0;31mFAILED\033[0m ]"; debugmes "**** The test was completed with " + .errors + " errors. ****"; @@ -786,6 +799,12 @@ OnTestScopeArrays: OnTestVarOfAnotherNPC: return getvariableofnpc(.x, getarg(0)); +OnTestGetdatatypeDefault: + return getdatatype(getarg(0, 0)); + +OnTestGetdatatype: + return getdatatype(getarg(0)); + OnReportError: .@msg$ = getarg(0,"Unknown Error"); .@val$ = getarg(1,""); |