Skip to content

Commit

Permalink
Sync test cases
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
keiravillekode committed Jan 2, 2025
1 parent 577e6dc commit de9e613
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 31 deletions.
3 changes: 3 additions & 0 deletions exercises/practice/allergies/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,6 @@ description = "list when: -> everything"

[12ce86de-b347-42a0-ab7c-2e0570f0c65b]
description = "list when: -> no allergen score parts"

[93c2df3e-4f55-4fed-8116-7513092819cd]
description = "list when: -> no allergen score parts without highest valid score"
11 changes: 11 additions & 0 deletions exercises/practice/allergies/allergies_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ void test_no_allergen_score_parts(void) {
TEST_ASSERT_EQUAL_INT_ARRAY(expected, item_list.items, item_list.size);
}

static void test_no_allergen_score_parts_without_highest_valid_score(void) {
TEST_IGNORE();
int expected[] = {EGGS};
struct item_list item_list;

list(257, &item_list);
TEST_ASSERT_EQUAL_INT(ARRAY_SIZE(expected), item_list.size);
TEST_ASSERT_EQUAL_INT_ARRAY(expected, item_list.items, item_list.size);
}

int main(void) {
UNITY_BEGIN();
RUN_TEST(test_eggs_not_allergic_to_anything);
Expand Down Expand Up @@ -368,5 +378,6 @@ int main(void) {
RUN_TEST(test_lots_of_stuff);
RUN_TEST(test_everything);
RUN_TEST(test_no_allergen_score_parts);
RUN_TEST(test_no_allergen_score_parts_without_highest_valid_score);
return UNITY_END();
}
5 changes: 5 additions & 0 deletions exercises/practice/bob/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ description = "alternate silence"

[66953780-165b-4e7e-8ce3-4bcb80b6385a]
description = "multiple line question"
include = false

[5371ef75-d9ea-4103-bcfa-2da973ddec1b]
description = "starting with whitespace"
Expand All @@ -83,3 +84,7 @@ description = "other whitespace"

[12983553-8601-46a8-92fa-fcaa3bc4a2a0]
description = "non-question ending with whitespace"

[2c7278ac-f955-4eb4-bf8f-e33eb4116a15]
description = "multiple line question"
reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a"
14 changes: 7 additions & 7 deletions exercises/practice/bob/bob_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ void test_alternate_silence(void) {
TEST_ASSERT_EQUAL_STRING("Fine. Be that way!", response(str));
}

void test_multiple_line_question(void) {
TEST_IGNORE();
char str[] = "\nDoes this cryogenic chamber make me look fat?\nNo.";
TEST_ASSERT_EQUAL_STRING("Whatever.", response(str));
}

void test_starting_with_whitespace(void) {
TEST_IGNORE();
char str[] = " hmmmmmmm...";
Expand All @@ -159,6 +153,12 @@ void test_nonquestion_ending_with_whitespace(void) {
TEST_ASSERT_EQUAL_STRING("Whatever.", response(str));
}

void test_multiple_line_question(void) {
TEST_IGNORE();
char str[] = "\nDoes this cryogenic chamber make\n me look fat?";
TEST_ASSERT_EQUAL_STRING("Sure.", response(str));
}

int main(void) {
UNITY_BEGIN();
RUN_TEST(test_stating_something);
Expand All @@ -181,10 +181,10 @@ int main(void) {
RUN_TEST(test_silence);
RUN_TEST(test_prolonged_silence);
RUN_TEST(test_alternate_silence);
RUN_TEST(test_multiple_line_question);
RUN_TEST(test_starting_with_whitespace);
RUN_TEST(test_ending_with_whitespace);
RUN_TEST(test_other_whitespace);
RUN_TEST(test_nonquestion_ending_with_whitespace);
RUN_TEST(test_multiple_line_question);
return UNITY_END();
}
12 changes: 12 additions & 0 deletions exercises/practice/reverse-string/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ description = "a palindrome"

[b9e7dec1-c6df-40bd-9fa3-cd7ded010c4c]
description = "an even-sized word"

[1bed0f8a-13b0-4bd3-9d59-3d0593326fa2]
description = "wide characters"
include = false

[93d7e1b8-f60f-4f3c-9559-4056e10d2ead]
description = "grapheme cluster with pre-combined form"
include = false

[1028b2c1-6763-4459-8540-2da47ca512d9]
description = "grapheme clusters"
include = false
3 changes: 3 additions & 0 deletions exercises/practice/roman-numerals/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@ description = "3000 is MMM"
[3bc4b41c-c2e6-49d9-9142-420691504336]
description = "3001 is MMMI"

[2f89cad7-73f6-4d1b-857b-0ef531f68b7e]
description = "3888 is MMMDCCCLXXXVIII"

[4e18e96b-5fbb-43df-a91b-9cb511fe0856]
description = "3999 is MMMCMXCIX"
9 changes: 9 additions & 0 deletions exercises/practice/roman-numerals/roman_numerals_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ void test_3001_is_mmmi(void) {
TEST_ASSERT_EQUAL_STRING("MMMI", buffer);
}

void test_3888_is_mmmdccclxxxviii(void) {
TEST_IGNORE();
char buffer[BUFFER_SIZE];

roman(3888, buffer);
TEST_ASSERT_EQUAL_STRING("MMMDCCCLXXXVIII", buffer);
}

void test_3999_is_mmmcmxcix(void) {
TEST_IGNORE();
char buffer[BUFFER_SIZE];
Expand Down Expand Up @@ -246,6 +254,7 @@ int main(void) {
RUN_TEST(test_1666_is_mdclxvi);
RUN_TEST(test_3000_is_mmm);
RUN_TEST(test_3001_is_mmmi);
RUN_TEST(test_3888_is_mmmdccclxxxviii);
RUN_TEST(test_3999_is_mmmcmxcix);
return UNITY_END();
}
4 changes: 4 additions & 0 deletions exercises/practice/space-age/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ description = "age on Uranus"

[80096d30-a0d4-4449-903e-a381178355d8]
description = "age on Neptune"

[57b96e2a-1178-40b7-b34d-f3c9c34e4bf4]
description = "invalid planet causes error"
include = false
57 changes: 35 additions & 22 deletions exercises/practice/triangle/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,60 +1,73 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# 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.

[8b2c43ac-7257-43f9-b552-7631a91988af]
description = "all sides are equal"
description = "equilateral triangle -> all sides are equal"

[33eb6f87-0498-4ccf-9573-7f8c3ce92b7b]
description = "any side is unequal"
description = "equilateral triangle -> any side is unequal"

[c6585b7d-a8c0-4ad8-8a34-e21d36f7ad87]
description = "no sides are equal"
description = "equilateral triangle -> no sides are equal"

[16e8ceb0-eadb-46d1-b892-c50327479251]
description = "all zero sides is not a triangle"
description = "equilateral triangle -> all zero sides is not a triangle"

[3022f537-b8e5-4cc1-8f12-fd775827a00c]
description = "sides may be floats"
description = "equilateral triangle -> sides may be floats"

[cbc612dc-d75a-4c1c-87fc-e2d5edd70b71]
description = "last two sides are equal"
description = "isosceles triangle -> last two sides are equal"

[e388ce93-f25e-4daf-b977-4b7ede992217]
description = "first two sides are equal"
description = "isosceles triangle -> first two sides are equal"

[d2080b79-4523-4c3f-9d42-2da6e81ab30f]
description = "first and last sides are equal"
description = "isosceles triangle -> first and last sides are equal"

[8d71e185-2bd7-4841-b7e1-71689a5491d8]
description = "equilateral triangles are also isosceles"
description = "isosceles triangle -> equilateral triangles are also isosceles"

[840ed5f8-366f-43c5-ac69-8f05e6f10bbb]
description = "no sides are equal"
description = "isosceles triangle -> no sides are equal"

[2eba0cfb-6c65-4c40-8146-30b608905eae]
description = "first triangle inequality violation"
description = "isosceles triangle -> first triangle inequality violation"

[278469cb-ac6b-41f0-81d4-66d9b828f8ac]
description = "second triangle inequality violation"
description = "isosceles triangle -> second triangle inequality violation"

[90efb0c7-72bb-4514-b320-3a3892e278ff]
description = "third triangle inequality violation"
description = "isosceles triangle -> third triangle inequality violation"

[adb4ee20-532f-43dc-8d31-e9271b7ef2bc]
description = "sides may be floats"
description = "isosceles triangle -> sides may be floats"

[e8b5f09c-ec2e-47c1-abec-f35095733afb]
description = "no sides are equal"
description = "scalene triangle -> no sides are equal"

[2510001f-b44d-4d18-9872-2303e7977dc1]
description = "all sides are equal"
description = "scalene triangle -> all sides are equal"

[c6e15a92-90d9-4fb3-90a2-eef64f8d3e1e]
description = "two sides are equal"
description = "scalene triangle -> first and second sides are equal"

[3da23a91-a166-419a-9abf-baf4868fd985]
description = "scalene triangle -> first and third sides are equal"

[b6a75d98-1fef-4c42-8e9a-9db854ba0a4d]
description = "scalene triangle -> second and third sides are equal"

[70ad5154-0033-48b7-af2c-b8d739cd9fdc]
description = "may not violate triangle inequality"
description = "scalene triangle -> may not violate triangle inequality"

[26d9d59d-f8f1-40d3-ad58-ae4d54123d7d]
description = "sides may be floats"
description = "scalene triangle -> sides may be floats"
18 changes: 16 additions & 2 deletions exercises/practice/triangle/triangle_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,24 @@ void test_scalene_triangle_all_sides_are_equal(void) {
TEST_ASSERT_EQUAL_INT(0, is_scalene(sides));
}

void test_scalene_triangle_two_sides_are_equal(void) {
void test_scalene_triangle_first_and_second_sides_are_equal(void) {
TEST_IGNORE();
triangle_t sides = { 4, 4, 3 } ;
TEST_ASSERT_EQUAL_INT(0, is_scalene(sides));
}

void test_scalene_triangle_first_and_third_sides_are_equal(void) {
TEST_IGNORE();
triangle_t sides = { 3, 4, 3 } ;
TEST_ASSERT_EQUAL_INT(0, is_scalene(sides));
}

void test_scalene_triangle_second_and_third_sides_are_equal(void) {
TEST_IGNORE();
triangle_t sides = { 4, 3, 3 } ;
TEST_ASSERT_EQUAL_INT(0, is_scalene(sides));
}

void test_scalene_triangle_may_not_violate_triangle_inequality(void) {
TEST_IGNORE();
triangle_t sides = { 7, 3, 2 } ;
Expand Down Expand Up @@ -149,7 +161,9 @@ int main(void) {
RUN_TEST(test_isosceles_triangle_sides_may_be_floats);
RUN_TEST(test_scalene_triangle_no_sides_are_equal);
RUN_TEST(test_scalene_triangle_all_sides_are_equal);
RUN_TEST(test_scalene_triangle_two_sides_are_equal);
RUN_TEST(test_scalene_triangle_first_and_second_sides_are_equal);
RUN_TEST(test_scalene_triangle_first_and_third_sides_are_equal);
RUN_TEST(test_scalene_triangle_second_and_third_sides_are_equal);
RUN_TEST(test_scalene_triangle_may_not_violate_triangle_inequality);
RUN_TEST(test_scalene_triangle_sides_may_be_floats);
return UNITY_END();
Expand Down

0 comments on commit de9e613

Please sign in to comment.