-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
updating tests for Reverse-String exercise #1037
base: main
Are you sure you want to change the base?
Conversation
Did you write an example solution in C that deals with unicode and grapheme clusters? |
The current tests and example implementation do not handle wide characters, grapheme clusters, UTF, etc. It only handles 8-bit ASCII characters. So unless this exercise is radically changed then these tests should be marked as not implemented and the failing tests removed. It mat be a good addition to the track to have an exercise that handles such characters (I don't think we have any other such exercise). But I don't know if this should be that exercise, and I don't think such a change is within the scope of the simple update that was intended. |
Hi @wolf99, I've temporarily commented out these tests for now. If there's a more standardized or preferred approach, please let me know, and I'll make the necessary adjustments. I was considering using Apologies for the delay in revisiting this; I was tied up with exams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jagdish-15
Unfortunately TEST_IGNORE()
is not suitable as we use this in valid tests that are expected to succeed as a student enables each one in turn (enabling them to use TDD loop to develop a solution).
Instead, because in this track we do not want to include these cases for this exercise, the tests need to be removed completely.
However, we need some way to mark that we have explicitly decided not to include these tests.
Luckily the .meta/tests.toml
file format allows this 😄
You can see the format details here: https://exercism.org/docs/building/tracks/practice-exercises#h-file-meta-tests-toml
My review suggestions here implement this.
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description = "wide characters" | |
description = "wide characters" | |
include = false | |
comment = "track decision to only handle ASCII strings for this exercise" |
description = "wide characters" | ||
|
||
[93d7e1b8-f60f-4f3c-9559-4056e10d2ead] | ||
description = "grapheme cluster with pre-combined form" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description = "grapheme cluster with pre-combined form" | |
description = "grapheme cluster with pre-combined form" | |
include = false | |
comment = "track decision to only handle ASCII strings for this exercise" |
description = "grapheme cluster with pre-combined form" | ||
|
||
[1028b2c1-6763-4459-8540-2da47ca512d9] | ||
description = "grapheme clusters" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description = "grapheme clusters" | |
description = "grapheme clusters" | |
include = false | |
comment = "track decision to only handle ASCII strings for this exercise" |
#if 0 | ||
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("ผู้เขียนโปรแกรม", "มรกแรปโนยขีเผู้"); | ||
} | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if 0 | |
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("ผู้เขียนโปรแกรม", "มรกแรปโนยขีเผู้"); | |
} | |
#endif |
/* | ||
* Commenting out the following tests for now because the current | ||
* implementation does not support handling wide characters, grapheme | ||
* clusters, or UTF characters. The implementation currently only handles | ||
* 8-bit ASCII characters, so these tests will cause failures when executed. | ||
* Once support for wider character sets is added, these tests can be | ||
* re-enabled for proper validation. | ||
*/ | ||
|
||
// RUN_TEST(test_wide_characters); | ||
// RUN_TEST(test_grapheme_cluster_with_pre_combined_form); | ||
// RUN_TEST(test_grapheme_clusters); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* | |
* Commenting out the following tests for now because the current | |
* implementation does not support handling wide characters, grapheme | |
* clusters, or UTF characters. The implementation currently only handles | |
* 8-bit ASCII characters, so these tests will cause failures when executed. | |
* Once support for wider character sets is added, these tests can be | |
* re-enabled for proper validation. | |
*/ | |
// RUN_TEST(test_wide_characters); | |
// RUN_TEST(test_grapheme_cluster_with_pre_combined_form); | |
// RUN_TEST(test_grapheme_clusters); |
Pull Request: Update Test Suite for Reverse-String Exercise
This pull request updates the test suite for the Reverse-String exercise, bringing it in line with the latest problem specification. With this update, all tests for the exercise are now fully synchronized.