From b6bdf656aa6ed2ebbf855a03ec03eabd24179b08 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 5 Oct 2015 19:42:22 +0300 Subject: Add initial script tests and add test1 and test2 npcs for this. --- npc/test/_import.txt | 2 ++ npc/test/test1.txt | 38 ++++++++++++++++++++++++++++++++++++++ npc/test/test2.txt | 13 +++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 npc/test/test1.txt create mode 100644 npc/test/test2.txt 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; +} -- cgit v1.2.3-70-g09d2