diff options
| author | Charlie Blake | 2018-04-05 15:54:20 +0100 |
|---|---|---|
| committer | GitHub | 2018-04-05 15:54:20 +0100 |
| commit | 4c4bf8a2e153b0ead77931285704aa7a0d2b7475 (patch) | |
| tree | 716b8cc644945daaa1d9665f7ffc98a25d4a36d4 /src/test | |
| parent | Merge pull request #48 from thecharlesblake/wider-testing (diff) | |
| parent | Add cmd line opts to list games and describe rules (diff) | |
| download | metasol-4c4bf8a2e153b0ead77931285704aa7a0d2b7475.tar.gz metasol-4c4bf8a2e153b0ead77931285704aa7a0d2b7475.zip | |
Merge pull request #49 from thecharlesblake/add-more-games
Add more games
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/unit_tests/legal_move_gen_test.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/unit_tests/legal_move_gen_test.cpp b/src/test/unit_tests/legal_move_gen_test.cpp index 23955c2..4f4b7ef 100644 --- a/src/test/unit_tests/legal_move_gen_test.cpp +++ b/src/test/unit_tests/legal_move_gen_test.cpp @@ -124,6 +124,25 @@ TEST(LegalMoveGen, SpacesPolAny) { ASSERT_TRUE(moves_eq(exp_moves, actual_moves)) << actual_moves; } +TEST(LegalMoveGen, SpacesPolKings) { + sol_rules sr; + sr.spaces_pol = s_pol::KINGS; + sr.tableau_pile_count = 3; + + game_state gs(sr, initializer_list<pile>{ + {}, + {"AC"}, + {"KD"} + }); + vector<mv> actual_moves = gs.get_legal_moves(); + + vector<mv> exp_moves = { + mv(2, 0) + }; + + ASSERT_TRUE(moves_eq(exp_moves, actual_moves)) << actual_moves; +} + TEST(LegalMoveGen, SpacesPolNoBuild) { sol_rules sr; sr.spaces_pol = s_pol::NO_BUILD; |
