diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-26 14:41:38 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-26 14:41:38 +0100 |
| commit | f4f436870f9ce0368d81c504e93b012e3928a851 (patch) | |
| tree | 61ea2ac873997600ca0aeb29669e9fef6f65bfe0 /tests/str.cpp | |
| parent | bb914f047b0d96464f3e55234907df4e7c416e97 (diff) | |
- Debug parser (carriage returns)
- Improve test framework
Diffstat (limited to 'tests/str.cpp')
| -rw-r--r-- | tests/str.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/str.cpp b/tests/str.cpp new file mode 100644 index 0000000..077cf49 --- /dev/null +++ b/tests/str.cpp @@ -0,0 +1,17 @@ +#include "pgnp.hpp" +#include <catch_amalgamated.hpp> + +using namespace pgnp; + +TEST_CASE("Seven Tag Roster", "[std/pgn1]") { + PGN pgn; + REQUIRE_NOTHROW(pgn.FromFile("pgn_files/str/pgn1.pgn")); + REQUIRE_NOTHROW(pgn.ParseNextGame()); + + REQUIRE_NOTHROW(pgn.STRCheck()); + HalfMove *m = new HalfMove(); + pgn.GetMoves(m); + REQUIRE(m->GetLength() == 85); + CHECK(pgn.GetResult() == "1/2-1/2"); + REQUIRE_THROWS_AS(pgn.ParseNextGame(),NoGameFound); +} |
