From 55a7f98bfffa06e2602218cf23849d7f8f7937ea Mon Sep 17 00:00:00 2001 From: vaeng <34183939+vaeng@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:40:31 +0200 Subject: [PATCH] tests: update uuids and toml file for high-scores --- .../practice/high-scores/.meta/tests.toml | 46 +++++++++++++++++++ .../practice/high-scores/high_scores_test.cpp | 38 ++++++++++----- 2 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 exercises/practice/high-scores/.meta/tests.toml diff --git a/exercises/practice/high-scores/.meta/tests.toml b/exercises/practice/high-scores/.meta/tests.toml new file mode 100644 index 00000000..7c946338 --- /dev/null +++ b/exercises/practice/high-scores/.meta/tests.toml @@ -0,0 +1,46 @@ +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. + +[1035eb93-2208-4c22-bab8-fef06769a73c] +description = "List of scores" + +[6aa5dbf5-78fa-4375-b22c-ffaa989732d2] +description = "Latest score" + +[b661a2e1-aebf-4f50-9139-0fb817dd12c6] +description = "Personal best" + +[3d996a97-c81c-4642-9afc-80b80dc14015] +description = "Top 3 scores -> Personal top three from a list of scores" + +[1084ecb5-3eb4-46fe-a816-e40331a4e83a] +description = "Top 3 scores -> Personal top highest to lowest" + +[e6465b6b-5a11-4936-bfe3-35241c4f4f16] +description = "Top 3 scores -> Personal top when there is a tie" + +[f73b02af-c8fd-41c9-91b9-c86eaa86bce2] +description = "Top 3 scores -> Personal top when there are less than 3" + +[16608eae-f60f-4a88-800e-aabce5df2865] +description = "Top 3 scores -> Personal top when there is only one" + +[2df075f9-fec9-4756-8f40-98c52a11504f] +description = "Top 3 scores -> Latest score after personal top scores" + +[809c4058-7eb1-4206-b01e-79238b9b71bc] +description = "Top 3 scores -> Scores after personal top scores" + +[ddb0efc0-9a86-4f82-bc30-21ae0bdc6418] +description = "Top 3 scores -> Latest score after personal best" + +[6a0fd2d1-4cc4-46b9-a5bb-2fb667ca2364] +description = "Top 3 scores -> Scores after personal best" diff --git a/exercises/practice/high-scores/high_scores_test.cpp b/exercises/practice/high-scores/high_scores_test.cpp index 57687414..9224f5c9 100644 --- a/exercises/practice/high-scores/high_scores_test.cpp +++ b/exercises/practice/high-scores/high_scores_test.cpp @@ -9,7 +9,7 @@ #endif // Declares a single test. -TEST_CASE("List of scores", "[scores]") { +TEST_CASE("List of scores", "[1035eb93-2208-4c22-bab8-fef06769a73c][scores]") { std::vector scores{30, 50, 20, 70}; arcade::HighScores hs{scores}; REQUIRE(hs.list_scores() == scores); @@ -17,56 +17,64 @@ TEST_CASE("List of scores", "[scores]") { #ifdef EXERCISM_RUN_ALL_TESTS -TEST_CASE("Latest score", "[latest]") { +TEST_CASE("Latest score", "[6aa5dbf5-78fa-4375-b22c-ffaa989732d2][latest]") { std::vector scores{100, 0, 90, 30}; int expected{30}; arcade::HighScores hs{scores}; REQUIRE(hs.latest_score() == expected); } -TEST_CASE("Personal best", "[personalBest]") { +TEST_CASE("Personal best", + "[b661a2e1-aebf-4f50-9139-0fb817dd12c6][personalBest]") { std::vector scores{40, 100, 70}; int expected{100}; arcade::HighScores hs{scores}; REQUIRE(hs.personal_best() == expected); } -TEST_CASE("Personal top three from a list of scores", "[personalTopThree]") { +TEST_CASE("Personal top three from a list of scores", + "[3d996a97-c81c-4642-9afc-80b80dc14015][personalTopThree]") { std::vector scores{10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 70}; std::vector expected{100, 90, 70}; arcade::HighScores hs{scores}; REQUIRE(hs.top_three() == expected); } -TEST_CASE("Personal top highest to lowest", "[personalTopThree]") { +TEST_CASE("Personal top highest to lowest", + "[1084ecb5-3eb4-46fe-a816-e40331a4e83a][personalTopThree]") { std::vector scores{20, 10, 30}; std::vector expected{30, 20, 10}; arcade::HighScores hs{scores}; REQUIRE(hs.top_three() == expected); } -TEST_CASE("Personal top when there is a tie", "[personalTopThree]") { +TEST_CASE("Personal top when there is a tie", + "[e6465b6b-5a11-4936-bfe3-35241c4f4f16][personalTopThree]") { std::vector scores{40, 20, 40, 30}; std::vector expected{40, 40, 30}; arcade::HighScores hs{scores}; REQUIRE(hs.top_three() == expected); } -TEST_CASE("Personal top when there are less than 3", "[personalTopThree]") { +TEST_CASE("Personal top when there are less than 3", + "[f73b02af-c8fd-41c9-91b9-c86eaa86bce2][personalTopThree]") { std::vector scores{30, 70}; std::vector expected{70, 30}; arcade::HighScores hs{scores}; REQUIRE(hs.top_three() == expected); } -TEST_CASE("Personal top when there is only one", "[personalTopThree]") { +TEST_CASE("Personal top when there is only one", + "[16608eae-f60f-4a88-800e-aabce5df2865][personalTopThree]") { std::vector scores{40}; std::vector expected{40}; arcade::HighScores hs{scores}; REQUIRE(hs.top_three() == expected); } -TEST_CASE("Latest score after personal top scores", "[immutable, latestAfterTopThree]") { +TEST_CASE( + "Latest score after personal top scores", + "[2df075f9-fec9-4756-8f40-98c52a11504f][immutable, latestAfterTopThree]") { // Test if latest_score is still valid after calling top_three std::vector scores{70, 50, 20, 30}; int expected{30}; @@ -75,7 +83,9 @@ TEST_CASE("Latest score after personal top scores", "[immutable, latestAfterTopT REQUIRE(hs.latest_score() == expected); } -TEST_CASE("Scores after personal top scores", "[immutable, scoresAfterTopThree]") { +TEST_CASE( + "Scores after personal top scores", + "[809c4058-7eb1-4206-b01e-79238b9b71bc][immutable, scoresAfterTopThree]") { // Test if list_scores is unchanged after calling top_three std::vector scores{30, 50, 20, 70}; arcade::HighScores hs{scores}; @@ -83,7 +93,9 @@ TEST_CASE("Scores after personal top scores", "[immutable, scoresAfterTopThree]" REQUIRE(hs.list_scores() == scores); } -TEST_CASE("Latest score after personal best", "[immutable, latestAfterBest]") { +TEST_CASE( + "Latest score after personal best", + "[ddb0efc0-9a86-4f82-bc30-21ae0bdc6418][immutable, latestAfterBest]") { // Test if latest_score is still valid after calling personal_best std::vector scores{20, 70, 15, 25, 30}; int expected{30}; @@ -92,7 +104,9 @@ TEST_CASE("Latest score after personal best", "[immutable, latestAfterBest]") { REQUIRE(hs.latest_score() == expected); } -TEST_CASE("Scores after personal best", "[immutable, scoresAfterBest]") { +TEST_CASE( + "Scores after personal best", + "[6a0fd2d1-4cc4-46b9-a5bb-2fb667ca2364][immutable, scoresAfterBest]") { // Test if list_scores is unchanged after calling personal_best std::vector scores{20, 70, 15, 25, 30}; arcade::HighScores hs{scores};