diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-24 15:29:22 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-24 15:29:22 +0100 |
| commit | 8c77f7a054eb15d3e73649bce5447f172a99969c (patch) | |
| tree | 051e2761b2f12c11861ce47fde4ea5c3ff2810b7 /tests/tests.cpp | |
| parent | fd78f92863361a3b25808f2ca988f820f2d35618 (diff) | |
Improve overall parsing
Diffstat (limited to 'tests/tests.cpp')
| -rw-r--r-- | tests/tests.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/tests.cpp b/tests/tests.cpp index 2877213..9c65975 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -1,6 +1,25 @@ +#include "pgnp.hpp" #include <catch_amalgamated.hpp> +using namespace pgnp; -TEST_CASE( "DUMMY TEST", "[test]" ) { - REQUIRE( 1 == 1 ); +TEST_CASE("Valid PGN", "[pgn1]") { + PGN pgn; + REQUIRE_NOTHROW(pgn.FromFile("pgn_files/valid/pgn1.pgn")); + REQUIRE_THROWS(pgn.STRCheck()); + REQUIRE(pgn.GetMoves()->GetLength() == 6); +} + +TEST_CASE("Valid PGN", "[pgn2]") { + PGN pgn; + REQUIRE_NOTHROW(pgn.FromFile("pgn_files/valid/pgn2.pgn")); + REQUIRE_THROWS(pgn.STRCheck()); + REQUIRE(pgn.GetMoves()->GetLength() == 66); +} + +TEST_CASE("Seven Tag Roster", "[pgn1]") { + PGN pgn; + REQUIRE_NOTHROW(pgn.FromFile("pgn_files/str/pgn1.pgn")); + REQUIRE_NOTHROW(pgn.STRCheck()); + REQUIRE(pgn.GetMoves()->GetLength() == 85); } |
