add a wml unit test for lua dofile

This commit is contained in:
Chris Beck 2014-12-05 15:30:12 -05:00
parent bae61e944f
commit 69d7924df5
3 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1 @@
return 1, 2, 3, 4

View File

@ -0,0 +1,18 @@
{GENERIC_UNIT_TEST "lua_dofile" (
[event]
name = prestart
[lua]
code = << a,b,c,d = wesnoth.dofile("test/macros/test.lua")
wesnoth.set_variable("a", a)
wesnoth.set_variable("b", b)
wesnoth.set_variable("c", c)
wesnoth.set_variable("d", d) >>
[/lua]
{ASSERT ({VARIABLE_CONDITIONAL a equals 1})}
{ASSERT ({VARIABLE_CONDITIONAL b equals 2})}
{ASSERT ({VARIABLE_CONDITIONAL c equals 3})}
{ASSERT ({VARIABLE_CONDITIONAL d equals 4})}
{RETURN [true][/true]}
[/event]
)}

View File

@ -83,6 +83,10 @@
0 filter_vision
0 has_ally
#
# LUA
#
0 lua_dofile
#
# Pathfinding
#
0 store_locations_one