Skip to content

Commit

Permalink
updating tests for Reverse-String exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
jagdish-15 committed Jan 9, 2025
1 parent d203f01 commit 21c95bb
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
3 changes: 3 additions & 0 deletions exercises/practice/reverse-string/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"authors": [
"keiravillekode"
],
"contributors": [
"jagdish-15"
],
"files": {
"solution": [
"reverse_string.c",
Expand Down
22 changes: 19 additions & 3 deletions exercises/practice/reverse-string/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# 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.

[c3b7d806-dced-49ee-8543-933fd1719b1c]
description = "an empty string"
Expand All @@ -19,3 +26,12 @@ description = "a palindrome"

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

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

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

[1028b2c1-6763-4459-8540-2da47ca512d9]
description = "grapheme clusters"
15 changes: 15 additions & 0 deletions exercises/practice/reverse-string/test_reverse_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ static void test_an_even_sized_word(void)
test_reverse("drawer", "reward");
}

static void test_wide_characters(void)
{
test_reverse("子猫", "猫子");
}

static void test_grapheme_cluster_with_pre_combined_form(void)
{
test_reverse("Würstchenstand", "dnatsnehctsrüW");
}

static void test_grapheme_clusters(void)
{
test_reverse("ผู้เขียนโปรแกรม", "มรกแรปโนยขีเผู้");
}

int main(void)
{
UNITY_BEGIN();
Expand Down

0 comments on commit 21c95bb

Please sign in to comment.