-
-
Notifications
You must be signed in to change notification settings - Fork 637
Syncing test.toml and updating the test code for reverse-string #2648
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
Merged
Cool-Katt
merged 6 commits into
exercism:main
from
jagdish-15:update-tests-reverse-string
Jun 13, 2025
+50
−5
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7607915
Syncing test.toml and updating the test code
jagdish-15 05699a2
Updating proof solution
jagdish-15 e462026
Running prettier
jagdish-15 8985774
Skipping the tests requiring segmenter
jagdish-15 e45e93e
Adding instructions.append.md
jagdish-15 b3b269f
Adding prettier ignore
jagdish-15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
exercises/practice/reverse-string/.docs/instructions.append.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!-- prettier-ignore-start --> | ||
~~~exercism/advanced | ||
If you solve this using the CLI, there are test cases that require you to deal with complex characters. | ||
You can optionally enable these tests by removing `.skip` from the test. | ||
~~~ | ||
<!-- prettier-ignore-end --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"contributors": [ | ||
"ankorGH", | ||
"d-vail", | ||
"jagdish-15", | ||
"ovidiu141", | ||
"SleeplessByte" | ||
], | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
export const reverseString = (string) => { | ||
let revString = ''; | ||
for (let i = string.length - 1; i >= 0; i -= 1) { | ||
revString += string[i]; | ||
let characters = Array.from( | ||
new Intl.Segmenter().segment(String(string)), | ||
(x) => x.segment, | ||
); | ||
for (let i = characters.length - 1; i >= 0; i--) { | ||
revString += characters[i]; | ||
} | ||
return revString; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This one passes with the previous solution? If yes, this is good, if no it also needs to be skipped :)
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.
Yes it does indeed pass with the previous solution (I remember it did pass with
[...string]
) but I'll still check it once again to be sureThere 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.
Yes, the old solution passes the test as well, so there’s no need to skip it.
By the way, should we stick with the segmenter solution or revert to the original?
I think keeping the segmenter version is a better choice, especially since it also passes the skipped tests.
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.
The proof solution is more for the CI, to prove that the tests can be passed, so the segmenter version can stay.