mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-27 19:38:33 +00:00
add a wml unit test for lua dofile
This commit is contained in:
parent
bae61e944f
commit
69d7924df5
1
data/test/macros/test.lua
Normal file
1
data/test/macros/test.lua
Normal file
@ -0,0 +1 @@
|
||||
return 1, 2, 3, 4
|
18
data/test/scenarios/test_dofile.cfg
Normal file
18
data/test/scenarios/test_dofile.cfg
Normal 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]
|
||||
)}
|
@ -83,6 +83,10 @@
|
||||
0 filter_vision
|
||||
0 has_ally
|
||||
#
|
||||
# LUA
|
||||
#
|
||||
0 lua_dofile
|
||||
#
|
||||
# Pathfinding
|
||||
#
|
||||
0 store_locations_one
|
||||
|
Loading…
x
Reference in New Issue
Block a user