-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
The order of the results actually matters for the Word Count exercise #931
Comments
Can confirm that the check function the tests use has a simple loop that implicitly expects the same order the expected output is given in. Option could either be to sort both the result and expected results to some same ordering, or just to improve this loop to not expect any order. |
I can update the tests to use the stdlib qsort. We just need a custom sort function for the struct with text/string and number of occurrences. That shouldn't be too bad to implement. TBH I just wanted to see some traction on the issue before doing the work. I'll try to open a PR tonight. |
Sorry about the delay. I'll try to look at any feedback on #932 as soon as possible. Thankfully this is a rather small PR. |
closed by #932 |
The instructions state that the order of the unique words does not matter when in fact they do.
https://github.com/exercism/c/blob/main/exercises/practice/word-count/.docs/instructions.md?plain=1#L21
The tests assume the word order is the order they are first encountered in.
Either the instructions should be updated, or the expected and actual results could just be sorted before the check to ensure a standard order of comparison. Personally, I would prefer the later option, and I could do some work in the future to make that happen if people are interested.
The text was updated successfully, but these errors were encountered: