add tests for {MOVE_UNIT} macro

This commit is contained in:
Chris Beck 2014-10-18 15:35:27 -04:00
parent b75f417982
commit a8d69793ee

View file

@ -0,0 +1,116 @@
{GENERIC_UNIT_TEST "test_move_unit" (
[event]
name=start
{ASSERT (
[have_unit]
id=alice
x=7
y=3
[/have_unit]
[have_unit]
id=bob
x=13
y=3
[/have_unit]
)}
{MOVE_UNIT id=alice 10 5}
{ASSERT (
[have_unit]
id=alice
x=10
y=5
[/have_unit]
[have_unit]
id=bob
x=13
y=3
[/have_unit]
)}
{MOVE_UNIT id=bob 10 7}
{ASSERT (
[have_unit]
id=alice
x=10
y=5
[/have_unit]
[have_unit]
id=bob
x=10
y=7
[/have_unit]
)}
{MOVE_UNIT id=alice 10 7}
{ASSERT (
[have_unit]
id=alice
x=9
y=7
[/have_unit]
[have_unit]
id=bob
x=10
y=7
[/have_unit]
)}
{MOVE_UNIT id=bob 10 4}
{ASSERT (
[have_unit]
id=alice
x=9
y=7
[/have_unit]
[have_unit]
id=bob
x=10
y=4
[/have_unit]
)}
{MOVE_UNIT id=bob 10 4}
{ASSERT (
[have_unit]
id=alice
x=9
y=7
[/have_unit]
[have_unit]
id=bob
x=10
y=4
[/have_unit]
)}
{UNIT 1 "Spearman" 13 5 (id=steve)}
{MOVE_UNIT id=alice 13 5}
{ASSERT (
[have_unit]
id=alice
x=12
y=4
[/have_unit]
[have_unit]
id=bob
x=10
y=4
[/have_unit]
[have_unit]
id=steve
x=13
y=5
[/have_unit]
)}
{RETURN ([true][/true])}
[/event]
)}