summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-05 19:42:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-05 19:42:22 +0300
commitb6bdf656aa6ed2ebbf855a03ec03eabd24179b08 (patch)
tree55dbf0bc91ed65b9d243e9e7fe84ca2c08bc36ba
parentf3ed28e0fa4034c27c056d515d0745e66d384be0 (diff)
downloadserverdata-b6bdf656aa6ed2ebbf855a03ec03eabd24179b08.tar.gz
serverdata-b6bdf656aa6ed2ebbf855a03ec03eabd24179b08.tar.bz2
serverdata-b6bdf656aa6ed2ebbf855a03ec03eabd24179b08.tar.xz
serverdata-b6bdf656aa6ed2ebbf855a03ec03eabd24179b08.zip
Add initial script tests and add test1 and test2 npcs for this.
-rw-r--r--npc/test/_import.txt2
-rw-r--r--npc/test/test1.txt38
-rw-r--r--npc/test/test2.txt13
3 files changed, 53 insertions, 0 deletions
diff --git a/npc/test/_import.txt b/npc/test/_import.txt
index 9998f29a..f98cb53b 100644
--- a/npc/test/_import.txt
+++ b/npc/test/_import.txt
@@ -6,3 +6,5 @@ npc: npc/test/npc2.txt
npc: npc/test/npc3.txt
npc: npc/test/npc4.txt
npc: npc/test/npc5.txt
+npc: npc/test/test1.txt
+npc: npc/test/test2.txt
diff --git a/npc/test/test1.txt b/npc/test/test1.txt
new file mode 100644
index 00000000..bcb0e455
--- /dev/null
+++ b/npc/test/test1.txt
@@ -0,0 +1,38 @@
+// Evol scripts.
+// Authors:
+// 4144
+// Description:
+// script tests
+
+function script test1function {
+ .var = .walkmask;
+ if (.var != 3)
+ mes "Error: testing test1 npc variables from function.";
+ .var = getvariableofnpc(.walkmask, "test1");
+ if (.var != 3)
+ mes "Error: testing test1 npc variables from function.";
+ .var = getvariableofnpc(.walkmask, "test2");
+ if (.var != 4)
+ mes "Error: testing test2 npc variables from function.";
+
+ return;
+}
+
+test,10,5,0 script test1 NPC_HAT_BOX,{
+ .var = .walkmask;
+ if (.var != 3)
+ mes "Error: testing test1 npc variables.";
+ .var = getvariableofnpc(.walkmask, "test1");
+ if (.var != 3)
+ mes "Error: testing test1 npc variables from function.";
+ .var = getvariableofnpc(.walkmask, "test2");
+ if (.var != 4)
+ mes "Error: testing test2 npc variables.";
+ test1function;
+ mes "Tests complete.";
+ close;
+
+OnInit:
+ .walkmask = 3;
+ end;
+}
diff --git a/npc/test/test2.txt b/npc/test/test2.txt
new file mode 100644
index 00000000..1afab34e
--- /dev/null
+++ b/npc/test/test2.txt
@@ -0,0 +1,13 @@
+// Evol scripts.
+// Authors:
+// 4144
+// Description:
+// script tests
+
+test,12,5,0 script test2 NPC_HAT_BOX,{
+ close;
+
+OnInit:
+ .walkmask = 4;
+ end;
+}