9
9
#endif
10
10
11
11
// Declares a single test.
12
- TEST_CASE (" List of scores" , " [scores]" ) {
12
+ TEST_CASE (" List of scores" , " [1035eb93-2208-4c22-bab8-fef06769a73c][ scores]" ) {
13
13
std::vector<int > scores{30 , 50 , 20 , 70 };
14
14
arcade::HighScores hs{scores};
15
15
REQUIRE (hs.list_scores () == scores);
16
16
}
17
17
18
18
#ifdef EXERCISM_RUN_ALL_TESTS
19
19
20
- TEST_CASE (" Latest score" , " [latest]" ) {
20
+ TEST_CASE (" Latest score" , " [6aa5dbf5-78fa-4375-b22c-ffaa989732d2][ latest]" ) {
21
21
std::vector<int > scores{100 , 0 , 90 , 30 };
22
22
int expected{30 };
23
23
arcade::HighScores hs{scores};
24
24
REQUIRE (hs.latest_score () == expected);
25
25
}
26
26
27
- TEST_CASE (" Personal best" , " [personalBest]" ) {
27
+ TEST_CASE (" Personal best" ,
28
+ " [b661a2e1-aebf-4f50-9139-0fb817dd12c6][personalBest]" ) {
28
29
std::vector<int > scores{40 , 100 , 70 };
29
30
int expected{100 };
30
31
arcade::HighScores hs{scores};
31
32
REQUIRE (hs.personal_best () == expected);
32
33
}
33
34
34
- TEST_CASE (" Personal top three from a list of scores" , " [personalTopThree]" ) {
35
+ TEST_CASE (" Personal top three from a list of scores" ,
36
+ " [3d996a97-c81c-4642-9afc-80b80dc14015][personalTopThree]" ) {
35
37
std::vector<int > scores{10 , 30 , 90 , 30 , 100 , 20 , 10 , 0 , 30 , 40 , 40 , 70 , 70 };
36
38
std::vector<int > expected{100 , 90 , 70 };
37
39
arcade::HighScores hs{scores};
38
40
REQUIRE (hs.top_three () == expected);
39
41
}
40
42
41
- TEST_CASE (" Personal top highest to lowest" , " [personalTopThree]" ) {
43
+ TEST_CASE (" Personal top highest to lowest" ,
44
+ " [1084ecb5-3eb4-46fe-a816-e40331a4e83a][personalTopThree]" ) {
42
45
std::vector<int > scores{20 , 10 , 30 };
43
46
std::vector<int > expected{30 , 20 , 10 };
44
47
arcade::HighScores hs{scores};
45
48
REQUIRE (hs.top_three () == expected);
46
49
}
47
50
48
- TEST_CASE (" Personal top when there is a tie" , " [personalTopThree]" ) {
51
+ TEST_CASE (" Personal top when there is a tie" ,
52
+ " [e6465b6b-5a11-4936-bfe3-35241c4f4f16][personalTopThree]" ) {
49
53
std::vector<int > scores{40 , 20 , 40 , 30 };
50
54
std::vector<int > expected{40 , 40 , 30 };
51
55
arcade::HighScores hs{scores};
52
56
REQUIRE (hs.top_three () == expected);
53
57
}
54
58
55
- TEST_CASE (" Personal top when there are less than 3" , " [personalTopThree]" ) {
59
+ TEST_CASE (" Personal top when there are less than 3" ,
60
+ " [f73b02af-c8fd-41c9-91b9-c86eaa86bce2][personalTopThree]" ) {
56
61
std::vector<int > scores{30 , 70 };
57
62
std::vector<int > expected{70 , 30 };
58
63
arcade::HighScores hs{scores};
59
64
REQUIRE (hs.top_three () == expected);
60
65
}
61
66
62
- TEST_CASE (" Personal top when there is only one" , " [personalTopThree]" ) {
67
+ TEST_CASE (" Personal top when there is only one" ,
68
+ " [16608eae-f60f-4a88-800e-aabce5df2865][personalTopThree]" ) {
63
69
std::vector<int > scores{40 };
64
70
std::vector<int > expected{40 };
65
71
arcade::HighScores hs{scores};
66
72
REQUIRE (hs.top_three () == expected);
67
73
}
68
74
69
- TEST_CASE (" Latest score after personal top scores" , " [immutable, latestAfterTopThree]" ) {
75
+ TEST_CASE (
76
+ " Latest score after personal top scores" ,
77
+ " [2df075f9-fec9-4756-8f40-98c52a11504f][immutable, latestAfterTopThree]" ) {
70
78
// Test if latest_score is still valid after calling top_three
71
79
std::vector<int > scores{70 , 50 , 20 , 30 };
72
80
int expected{30 };
@@ -75,15 +83,19 @@ TEST_CASE("Latest score after personal top scores", "[immutable, latestAfterTopT
75
83
REQUIRE (hs.latest_score () == expected);
76
84
}
77
85
78
- TEST_CASE (" Scores after personal top scores" , " [immutable, scoresAfterTopThree]" ) {
86
+ TEST_CASE (
87
+ " Scores after personal top scores" ,
88
+ " [809c4058-7eb1-4206-b01e-79238b9b71bc][immutable, scoresAfterTopThree]" ) {
79
89
// Test if list_scores is unchanged after calling top_three
80
90
std::vector<int > scores{30 , 50 , 20 , 70 };
81
91
arcade::HighScores hs{scores};
82
92
hs.top_three ();
83
93
REQUIRE (hs.list_scores () == scores);
84
94
}
85
95
86
- TEST_CASE (" Latest score after personal best" , " [immutable, latestAfterBest]" ) {
96
+ TEST_CASE (
97
+ " Latest score after personal best" ,
98
+ " [ddb0efc0-9a86-4f82-bc30-21ae0bdc6418][immutable, latestAfterBest]" ) {
87
99
// Test if latest_score is still valid after calling personal_best
88
100
std::vector<int > scores{20 , 70 , 15 , 25 , 30 };
89
101
int expected{30 };
@@ -92,7 +104,9 @@ TEST_CASE("Latest score after personal best", "[immutable, latestAfterBest]") {
92
104
REQUIRE (hs.latest_score () == expected);
93
105
}
94
106
95
- TEST_CASE (" Scores after personal best" , " [immutable, scoresAfterBest]" ) {
107
+ TEST_CASE (
108
+ " Scores after personal best" ,
109
+ " [6a0fd2d1-4cc4-46b9-a5bb-2fb667ca2364][immutable, scoresAfterBest]" ) {
96
110
// Test if list_scores is unchanged after calling personal_best
97
111
std::vector<int > scores{20 , 70 , 15 , 25 , 30 };
98
112
arcade::HighScores hs{scores};
0 commit comments