Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: have test name on one line again #946

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions exercises/concept/lasagna-master/lasagna_master_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ using namespace lasagna_master;
}

TEST_CASE(
"preparationTime: Preparation time for many layers with custom average "
"time",
// clang-format off
"preparationTime: Preparation time for many layers with custom average time",
// clang-format on
"[task_1]") {
std::vector<std::string> layers{
"sauce", "noodles", "béchamel", "meat",
Expand Down
5 changes: 3 additions & 2 deletions exercises/concept/pacman-rules/pacman_rules_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ TEST_CASE("ghost does not get eaten because not touching ghost", "[task_1]") {
}

TEST_CASE(
"ghost does not get eaten because no power pellet is active, even if not "
"touching ghost",
// clang-format off
"ghost does not get eaten because no power pellet is active, even if not touching ghost",
// clang-format on
"[task_1]") {
REQUIRE_FALSE(can_eat_ghost(false, false));
}
Expand Down
10 changes: 6 additions & 4 deletions exercises/practice/allergies/allergies_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,17 @@ TEST_CASE("testing for strawberries allergy -> allergic only to strawberries",
}

TEST_CASE(
"testing for strawberries allergy -> allergic to strawberries and "
"something else",
// clang-format off
"testing for strawberries allergy -> allergic to strawberries and something else",
// clang-format on
"[50f5f8f3-3bac-47e6-8dba-2d94470a4bc6]") {
REQUIRE(true == allergies::allergy_test(28).is_allergic_to("strawberries"));
}

TEST_CASE(
"testing for strawberries allergy -> allergic to something, but not "
"strawberries",
// clang-format off
"testing for strawberries allergy -> allergic to something, but not strawberries",
// clang-format on
"[23dd6952-88c9-48d7-a7d5-5d0343deb18d]") {
REQUIRE(false ==
allergies::allergy_test(20).is_allergic_to("strawberries"));
Expand Down
70 changes: 42 additions & 28 deletions exercises/practice/complex-numbers/complex_numbers_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ TEST_CASE("Arithmetic -> Subtraction -> Subtract purely imaginary numbers",
}

TEST_CASE(
"Arithmetic -> Subtraction -> Subtract numbers with real and imaginary "
"part",
// clang-format off
"Arithmetic -> Subtraction -> Subtract numbers with real and imaginary part",
// clang-format on
"[f876feb1-f9d1-4d34-b067-b599a8746400]") {
const Complex c1{1.0, 2.0};
const Complex c2{3.0, 4.0};
Expand All @@ -148,8 +149,9 @@ TEST_CASE("Arithmetic -> Multiplication -> Multiply purely imaginary numbers",
}

TEST_CASE(
"Arithmetic -> Multiplication -> Multiply numbers with real and imaginary "
"part",
// clang-format off
"Arithmetic -> Multiplication -> Multiply numbers with real and imaginary part",
// clang-format on
"[4d1d10f0-f8d4-48a0-b1d0-f284ada567e6]") {
const Complex c1{1.0, 2.0};
const Complex c2{3.0, 4.0};
Expand Down Expand Up @@ -197,17 +199,19 @@ TEST_CASE("Absolute value -> Absolute value of a negative purely real number",
}

TEST_CASE(
"Absolute value -> Absolute value of a purely imaginary number with "
"positive imaginary part",
// clang-format off
"Absolute value -> Absolute value of a purely imaginary number with positive imaginary part",
// clang-format on
"[bbe26568-86c1-4bb4-ba7a-da5697e2b994]") {
const Complex c{0.0, 5.0};

REQUIRE_THAT(c.abs(), Catch::Matchers::WithinAbs(5.0, eps));
}

TEST_CASE(
"Absolute value -> Absolute value of a purely imaginary number with "
"negative imaginary part",
// clang-format off
"Absolute value -> Absolute value of a purely imaginary number with negative imaginary part",
// clang-format on
"[3b48233d-468e-4276-9f59-70f4ca1f26f3]") {
const Complex c{0.0, -5.0};

Expand Down Expand Up @@ -267,89 +271,99 @@ TEST_CASE("Complex exponential function -> Exponential of a purely real number",

// Extra Credit
TEST_CASE(
"Complex exponential function -> Exponential of a number with real and "
"imaginary part",
// clang-format off
"Complex exponential function -> Exponential of a number with real and imaginary part",
// clang-format on
"[08eedacc-5a95-44fc-8789-1547b27a8702]") {
const Complex c{std::log(2.0), M_PI};

require_approx_equal(Complex(-2.0, 0.0), c.exp());
}

TEST_CASE(
"Complex exponential function -> Exponential resulting in a number with "
"real and imaginary part",
// clang-format off
"Complex exponential function -> Exponential resulting in a number with real and imaginary part",
// clang-format on
"[d2de4375-7537-479a-aa0e-d474f4f09859]") {
const Complex c{std::log(2.0) / 2.0, M_PI / 4.0};

require_approx_equal(Complex(1.0, 1.0), c.exp());
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Add real number to "
"complex number",
// clang-format off
"Operations between real numbers and complex numbers -> Add real number to complex number",
// clang-format on
"[06d793bf-73bd-4b02-b015-3030b2c952ec]") {
const Complex c{1.0, 2.0};

require_approx_equal(Complex(6.0, 2.0), c + 5.0);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Add complex number "
"to real number",
// clang-format off
"Operations between real numbers and complex numbers -> Add complex number to real number",
// clang-format on
"[d77dbbdf-b8df-43f6-a58d-3acb96765328]") {
const Complex c{1.0, 2.0};

require_approx_equal(Complex(6.0, 2.0), 5.0 + c);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Subtract real "
"number from complex number",
// clang-format off
"Operations between real numbers and complex numbers -> Subtract real number from complex number",
// clang-format on
"[20432c8e-8960-4c40-ba83-c9d910ff0a0f]") {
const Complex c{5.0, 7.0};

require_approx_equal(Complex(1.0, 7.0), c - 4.0);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Subtract complex "
"number from real number",
// clang-format off
"Operations between real numbers and complex numbers -> Subtract complex number from real number",
// clang-format on
"[b4b38c85-e1bf-437d-b04d-49bba6e55000]") {
const Complex c{5.0, 7.0};

require_approx_equal(Complex(-1.0, -7.0), 4.0 - c);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Multiply complex "
"number by real number",
// clang-format off
"Operations between real numbers and complex numbers -> Multiply complex number by real number",
// clang-format on
"[dabe1c8c-b8f4-44dd-879d-37d77c4d06bd]") {
const Complex c{2.0, 5.0};

require_approx_equal(Complex(10.0, 25.0), c * 5.0);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Multiply real "
"number by complex number",
// clang-format off
"Operations between real numbers and complex numbers -> Multiply real number by complex number",
// clang-format on
"[6c81b8c8-9851-46f0-9de5-d96d314c3a28]") {
const Complex c{2.0, 5.0};

require_approx_equal(Complex(10.0, 25.0), 5.0 * c);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Divide complex "
"number by real number",
// clang-format off
"Operations between real numbers and complex numbers -> Divide complex number by real number",
// clang-format on
"[8a400f75-710e-4d0c-bcb4-5e5a00c78aa0]") {
const Complex c{10.0, 100.0};

require_approx_equal(Complex(1.0, 10.0), c / 10.0);
}

TEST_CASE(
"Operations between real numbers and complex numbers -> Divide real number "
"by complex number",
// clang-format off
"Operations between real numbers and complex numbers -> Divide real number by complex number",
// clang-format on
"[9a867d1b-d736-4c41-a41e-90bd148e9d5e]") {
const Complex c{1.0, 1.0};

Expand Down
10 changes: 6 additions & 4 deletions exercises/practice/linked-list/linked_list_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ TEST_CASE("erases the element with the specified value from the list",
}

TEST_CASE(
"erases the element with the specified value from the list, re-assigns "
"tail",
// clang-format off
"erases the element with the specified value from the list, re-assigns tail",
// clang-format on
"[59db191a-b17f-4ab7-9c5c-60711ec1d013]") {
linked_list::List<int> llist{};
llist.push(71);
Expand All @@ -152,8 +153,9 @@ TEST_CASE(
}

TEST_CASE(
"erases the element with the specified value from the list, re-assigns "
"head",
// clang-format off
"erases the element with the specified value from the list, re-assigns head",
// clang-format on
"[58242222-5d39-415b-951d-8128247f8993]") {
linked_list::List<int> llist{};
llist.push(71);
Expand Down
5 changes: 3 additions & 2 deletions exercises/practice/luhn/luhn_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ TEST_CASE("using ascii value for doubled non-digit isn't allowed",
}

TEST_CASE(
"non-numeric, non-space char in the middle with a sum that's divisible by "
"10 isn't allowed",
// clang-format off
"non-numeric, non-space char in the middle with a sum that's divisible by 10 isn't allowed",
// clang-format on
"[8b72ad26-c8be-49a2-b99c-bcc3bf631b33]") {
REQUIRE(false == luhn::valid("59%59"));
}
Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/queen-attack/queen_attack_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ TEST_CASE("queens_can_attack_on_fourth_diagonal") {
}

TEST_CASE(
"queens_cannot_attack_if_falling_diagonals_are_only_the_same_when_"
"reflected_across_the_longest_falling_diagonal") {
// clang-format off
"queens_cannot_attack_if_falling_diagonals_are_only_the_same_when_reflected_across_the_longest_falling_diagonal"
// clang-format on
) {
const queen_attack::chess_board board{std::make_pair(4, 1),
std::make_pair(2, 5)};

Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/raindrops/raindrops_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ TEST_CASE("the_sound_for_6_is_pling_as_it_has_a_factor_3") {
REQUIRE("Pling" == raindrops::convert(6));
}
TEST_CASE(
"2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_"
"the_base") {
// clang-format off
"2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base"
// clang-format on
) {
REQUIRE("8" == raindrops::convert(8));
}
TEST_CASE("the_sound_for_9_is_pling_as_it_has_a_factor_3") {
Expand Down
30 changes: 18 additions & 12 deletions exercises/practice/two-bucket/two_bucket_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ CATCH_REGISTER_ENUM(two_bucket::bucket_id, two_bucket::bucket_id::one,
two_bucket::bucket_id::two)

TEST_CASE(
"Measure using bucket one of size 3 and bucket two of size 5 - start with "
"bucket one",
// clang-format off
"Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one",
// clang-format on
"[a6f2b4ba-065f-4dca-b6f0-e3eee51cb661]") {
auto bucket1_capacity = 3;
auto bucket2_capacity = 5;
Expand All @@ -28,8 +29,9 @@ TEST_CASE(
#if defined(EXERCISM_RUN_ALL_TESTS)

TEST_CASE(
"Measure using bucket one of size 3 and bucket two of size 5 - start with "
"bucket two",
// clang-format off
"Measure using bucket one of size 3 and bucket two of size 5 - start with bucket two",
// clang-format on
"[6c4ea451-9678-4926-b9b3-68364e066d40]") {
auto bucket1_capacity = 3;
auto bucket2_capacity = 5;
Expand All @@ -45,8 +47,9 @@ TEST_CASE(
}

TEST_CASE(
"Measure using bucket one of size 7 and bucket two of size 11 - start with "
"bucket one",
// clang-format off
"Measure using bucket one of size 7 and bucket two of size 11 - start with bucket one",
// clang-format on
"[3389f45e-6a56-46d5-9607-75aa930502ff]") {
auto bucket1_capacity = 7;
auto bucket2_capacity = 11;
Expand All @@ -62,8 +65,9 @@ TEST_CASE(
}

TEST_CASE(
"Measure using bucket one of size 7 and bucket two of size 11 - start with "
"bucket two",
// clang-format off
"Measure using bucket one of size 7 and bucket two of size 11 - start with bucket two",
// clang-format on
"[fe0ff9a0-3ea5-4bf7-b17d-6d4243961aa1]") {
auto bucket1_capacity = 7;
auto bucket2_capacity = 11;
Expand All @@ -79,8 +83,9 @@ TEST_CASE(
}

TEST_CASE(
"Measure one step using bucket one of size 1 and bucket two of size 3 - "
"start with bucket two",
// clang-format off
"Measure one step using bucket one of size 1 and bucket two of size 3 - start with bucket two",
// clang-format on
"[0ee1f57e-da84-44f7-ac91-38b878691602]") {
auto bucket1_capacity = 1;
auto bucket2_capacity = 3;
Expand All @@ -96,8 +101,9 @@ TEST_CASE(
}

TEST_CASE(
"Measure using bucket one of size 2 and bucket two of size 3 - start with "
"bucket one and end with bucket two",
// clang-format off
"Measure using bucket one of size 2 and bucket two of size 3 - start with bucket one and end with bucket two",
// clang-format on
"[eb329c63-5540-4735-b30b-97f7f4df0f84]") {
auto bucket1_capacity = 2;
auto bucket2_capacity = 3;
Expand Down
Loading