aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-01-24 18:32:05 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-01-24 18:32:05 +0100
commit5d4a7d66cba27b946ac155983d8b1710b353aaae (patch)
tree59fabec41c90c061695f6f8925cfdef470053d47 /tests
parentaf333f9ff1c5e7e31d69f58e4559a14cdcfa4f9d (diff)
Cleaning tests
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/pgn_files/valid/pgn1.pgn2
-rw-r--r--tests/tests.cpp10
3 files changed, 8 insertions, 5 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index fe07b37..4b556aa 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -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)
diff --git a/tests/pgn_files/valid/pgn1.pgn b/tests/pgn_files/valid/pgn1.pgn
index f593f02..d9808a5 100644
--- a/tests/pgn_files/valid/pgn1.pgn
+++ b/tests/pgn_files/valid/pgn1.pgn
@@ -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 *
diff --git a/tests/tests.cpp b/tests/tests.cpp
index 3838ef6..d766abd 100644
--- a/tests/tests.cpp
+++ b/tests/tests.cpp
@@ -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");
}