mirror of
https://gitlab.com/manzerbredes/pgnp.git
synced 2025-04-19 03:49:43 +00:00
- Debug parser (carriage returns)
- Improve test framework
This commit is contained in:
parent
bb914f047b
commit
f4f436870f
11 changed files with 1577 additions and 32 deletions
17
tests/str.cpp
Normal file
17
tests/str.cpp
Normal file
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue