add test_move unit tests

This commit is contained in:
Chris Beck 2014-05-16 21:25:23 -04:00
parent 77993f9d98
commit d7374f4080
2 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,70 @@
# This series of tests checks that [move] handles malformed x,y lists correctly.
#define MOVE_MALFORMED_SCEN ID PX PY
[test]
name = "Unit Test {ID}"
map_data = "{test/maps/move_skip_sighted.map}"
turns = 3
id = {ID}
random_start_time = no
{DAWN}
[side]
side=1
controller=human
name = "Alice"
type = Elvish Archer
id=alice
fog=yes
share_view=no
[/side]
[side]
side=2
controller=human
name = "Bob"
type = Orcish Grunt
id=bob
fog=yes
team_name=East
share_view=no
[/side]
[side]
side=3
controller=human
name = "Dave"
type = Dwarvish Fighter
id=dave
fog=yes
team_name=East
share_view=no
[/side]
[event]
name = side 1 turn 1
[end_turn]
[/end_turn]
[/event]
[event]
name = side 2 turn 1
[do_command]
[move]
x={PX}
y={PY}
[/move]
[/do_command]
{RETURN ([true][/true])}
[/event]
[/test]
#enddef
{MOVE_MALFORMED_SCEN test_move (16,15,14,13,12,11) (3,3,3,3,3,3)}
{MOVE_MALFORMED_SCEN test_move_fail_1 (16,15,14,13,12,11,10) (3,3,3,3,3,3)}
{MOVE_MALFORMED_SCEN test_move_fail_2 (16,15,14,13,12,11) (3,3,3,3,3,3,3)}
{MOVE_MALFORMED_SCEN test_move_fail_3 (16,15,14,13,12,11) (3,3,3,3,3)}
{MOVE_MALFORMED_SCEN test_move_fail_4 (16,15,14,13,12) (3,3,3,3,3,3)}
{MOVE_MALFORMED_SCEN test_move_fail_5 (16,15,chicken,13,12,11) (3,3,3,3,3,3)}
{MOVE_MALFORMED_SCEN test_move_fail_6 (16,15,14,13,12,11) (3,3,3,3,3,bock)}

View file

@ -18,6 +18,13 @@
0 order_of_nested_events 0 order_of_nested_events
0 unit_spawns_at_nearest_vacant_hex 0 unit_spawns_at_nearest_vacant_hex
0 units_offmap_goto_recall 0 units_offmap_goto_recall
0 test_move
1 test_move_fail_1
1 test_move_fail_2
1 test_move_fail_3
1 test_move_fail_4
1 test_move_fail_5
1 test_move_fail_6
0 sighted_events 0 sighted_events
1 sighted_events_fail 1 sighted_events_fail
0 sighted_on_opponents_turn 0 sighted_on_opponents_turn