mirror of
https://gitlab.com/manzerbredes/pgnp.git
synced 2025-06-06 13:27:39 +00:00
Cleaning tests
This commit is contained in:
parent
af333f9ff1
commit
5d4a7d66cb
7 changed files with 33 additions and 8 deletions
|
@ -6,4 +6,3 @@ file(COPY pgn_files DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
|
|||
# Run tests
|
||||
add_executable(pgnp_tests tests.cpp ./catch3/catch_amalgamated.cpp)
|
||||
target_link_libraries(pgnp_tests pgnp)
|
||||
add_test(PGNP_Tests pgnp_tests)
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
[Termination "Normal"]
|
||||
[Annotator "lichess.org"]
|
||||
|
||||
1. g3 d5 2. Bg2 Nf6 3. c4 c6
|
||||
1. g3 d5 2. Bg2 Nf6 3. c4 c6 *
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using namespace pgnp;
|
||||
|
||||
TEST_CASE("Valid PGN", "[pgn1]") {
|
||||
TEST_CASE("Valid PGN", "[valid/pgn1]") {
|
||||
PGN pgn;
|
||||
REQUIRE_NOTHROW(pgn.FromFile("pgn_files/valid/pgn1.pgn"));
|
||||
REQUIRE_THROWS(pgn.STRCheck());
|
||||
|
@ -55,18 +55,22 @@ TEST_CASE("Valid PGN", "[pgn1]") {
|
|||
CHECK(pgn.GetTagValue("TimeControl") == "600+5");
|
||||
CHECK_THROWS_AS(pgn.GetTagValue("InvalidTagName"), InvalidTagName);
|
||||
}
|
||||
|
||||
CHECK(pgn.GetResult() == "*");
|
||||
}
|
||||
|
||||
TEST_CASE("Valid PGN", "[pgn2]") {
|
||||
TEST_CASE("Valid PGN", "[valid/pgn2]") {
|
||||
PGN pgn;
|
||||
REQUIRE_NOTHROW(pgn.FromFile("pgn_files/valid/pgn2.pgn"));
|
||||
REQUIRE_THROWS(pgn.STRCheck());
|
||||
REQUIRE(pgn.GetMoves()->GetLength() == 66);
|
||||
CHECK(pgn.GetResult() == "0-1");
|
||||
}
|
||||
|
||||
TEST_CASE("Seven Tag Roster", "[pgn1]") {
|
||||
TEST_CASE("Seven Tag Roster", "[std/pgn1]") {
|
||||
PGN pgn;
|
||||
REQUIRE_NOTHROW(pgn.FromFile("pgn_files/str/pgn1.pgn"));
|
||||
REQUIRE_NOTHROW(pgn.STRCheck());
|
||||
REQUIRE(pgn.GetMoves()->GetLength() == 85);
|
||||
CHECK(pgn.GetResult() == "1/2-1/2");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue