Skip to content
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
9 changes: 9 additions & 0 deletions exercises/practice/acronym/acronym_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ void test_underscore_emphasis(void) {
TEST_ASSERT_EQUAL_STRING("TRNT", buffer);
}

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

abbreviate(buffer, "point of view");
TEST_ASSERT_EQUAL_STRING("POV", buffer);
}

int main(void) {
UNITY_BEGIN();
RUN_TEST(test_basic);
Expand All @@ -92,5 +100,6 @@ int main(void) {
RUN_TEST(test_consecutive_delimiters);
RUN_TEST(test_apostrophes);
RUN_TEST(test_underscore_emphasis);
RUN_TEST(test_all_lowercase);
return UNITY_END();
}
11 changes: 11 additions & 0 deletions exercises/practice/run-length-encoding/run_length_encoding_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ void test_consistency_encode_followed_by_decode_gives_original_string(void) {
TEST_ASSERT_EQUAL_STRING("zzz ZZ zZ", buffer2);
}

void test_consistency_consistency_with_punctuation(void) {
TEST_IGNORE();
char buffer1[BUFFER_SIZE];
char buffer2[BUFFER_SIZE];

encode(buffer1, "\t\t///::::\xB0@@@[[```{{{{");
decode(buffer2, buffer1);
TEST_ASSERT_EQUAL_STRING("\t\t///::::\xB0@@@[[```{{{{", buffer2);
}

void test_encode_long_run(void) {
TEST_IGNORE();
char buffer[BUFFER_SIZE];
Expand Down Expand Up @@ -150,6 +160,7 @@ int main(void) {
RUN_TEST(test_decode_multiple_whitespace_mixed_in_string);
RUN_TEST(test_decode_lowercase_string);
RUN_TEST(test_consistency_encode_followed_by_decode_gives_original_string);
RUN_TEST(test_consistency_consistency_with_punctuation);
RUN_TEST(test_encode_long_run);
RUN_TEST(test_decode_long_run);
return UNITY_END();
Expand Down
11 changes: 11 additions & 0 deletions generators/exercises/acronym.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
"""


def extra_cases():
return [
{
"description": "all lowercase",
"property": "abbreviate",
"input": {"phrase": "point of view"},
"expected": "POV",
}
]


def gen_func_body(prop, inp, expected):
phrase = inp["phrase"]
str_list = []
Expand Down
6 changes: 6 additions & 0 deletions generators/exercises/run_length_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

def extra_cases():
return [
{
"description": "consistency with punctuation",
"property": "consistency",
"input": {"string": "\\t\\t///::::\\xB0@@@[[```{{{{"},
"expected": "\\t\\t///::::\\xB0@@@[[```{{{{",
},
{
"description": "long run",
"property": "encode",
Expand Down
Loading