You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incomplete tests for pig-latin exercise allows to apply one pattern to all words in phrase #2696
While mentioning a student's solution, I noticed that his/her solution makes a wrong assumption that phrase always consists of words with the same type (all words starting with consonants or all words starting with vowels).
Then I tried to lead student towards a canonical solution, but to my suprise, the canonical solution have the same bug. And despite of bug, both solutions (canonical and student's) pass all tests in suite.
Why this happened
Almost all tests in the suite tests a single word (for which the incorrect assumption that phrase always contains words of one type always holds). Due to the unfortunate decision the only test that contains several words contain only words of the same type, too (the ones starting with consonants).
Steps to reproduce the issue
Below are the steps to reproduce the issue with the problematic test quick fast run.
Note that this test contain only words starting with consonants.
root@localhost:~# dotnet fsi
F# Interactive version 14.0.111.0 for F# 10.0
> #load "Example.fs";;
[Loading /root/Example.fs]
module FSI_0002.PigLatin
val vowelPattern: string
val consonantPattern: string
val vowelReplacement: string
val consonantReplacement: string
val translate: sentence: string -> string
Test the solution on original test and on any phrase with words of mixed type:
> PigLatin.translate "quick fast run";;
val it: string = "ickquay astfay unray"
> PigLatin.translate "quick afternoon run";;
val it: string = "quick afternoonay run"
You will notice that it uses consonants pattern for all words in the first test (and this works here - lucky!), and vowel pattern for all words in the second test (which is incorrect, because only one word start with vowel, not all of them).
A proposal
To help students catch the bug, a test is proposed which contains not only words starting with consonants, but a mix of words of different types. This helps to ensure that the decision for each word is taken individually, not like one pattern is applied to all words.
At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.
This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!
If you're interested in learning more about this auto-responder, please read this blog post.
Please clean up the commit message. It should explain what is changing and briefly why. You can link to the forum for context, but should not include a whole story in the commit. Please review prior commits to see what a commit message typically looks like.
And please don't use AI to rewrite it. Spend a minute and summarize the change yourself. It's a good skill to practice, and it shows respect for the time of everyone reading it.
Add a test to pig-latin exercise that reimplements test with whole phrase (uuid 44616581-5ce3-4a81-82d0-40c7ab13d2cf)
Examples of previous commits are:
One commit:
[resistor-color-tolerance] Correct tolerance in expected output: grey is 0.05% tolerance
[resistor-color-tolerance] Correct tolerance in expected output: grey is 0.05% tolerance
Add the reimplements key
Reorder keys
Another commit:
state-of-tic-tac-toe: Add test cases for playing after a win
Add two new canonical test cases to verify that an error is thrown
when a player makes a move after the game has already been won:
O kept playing after X wins
X kept playing after O wins
After studying previous commits, I plan to modify my commit message to:
Add new canonical test to verify that student's program analyses and processes each word individually, without trying to apply a single pattern to all words
Add the reimplements key
Add the comments key with brief description of reason behind introduction of new test
Add new canonical test to verify that student's program analyses and processes each word individually, without trying to apply a single pattern to all words
Add the reimplements key
Add the comments key with brief description of reason behind introduction of new test
This is a good start.
The first line of a commit is the summary line. The first sentence looks like a good summary. The second sentence with the forum link should not be in the summary -- it should be in the body after the blank line.
You can (and should) use markdown. A discussion of new test case is here: https://forum.exercism.org/t/add-tests-to-pig-latin-exercise/95998/36 can be simplified to [See forum discussion](https://forum.exercism.org/t/add-tests-to-pig-latin-exercise/95998/)
There's no need to mention the reimplements or comments in the commit message. People can see what is added by looking at the code. The commit should explain, at a high level, what changed and why. It should not repeat what is in the code.
Add new canonical test to verify that student's program analyses and processes each word individually, without trying to apply a single pattern to all words
I probably made some mistake and the change is not complete. But first of all, how can I reproduce the issue? Since it shows new commit message at given link.
17. I probably made some mistake and the change is not complete. But first of all, how can I reproduce the issue? Since it shows new commit message at given link.
Click the pencil icon next to the title to edit the title.
Activity
github-actions commentedon Nov 2, 2026
Hello. Thanks for opening an issue on Exercism 🙂
At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.
This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!
If you're interested in learning more about this auto-responder, please read this blog post.
IsaacG commentedon Nov 2, 2026
Please clean up the commit message. It should explain what is changing and briefly why. You can link to the forum for context, but should not include a whole story in the commit. Please review prior commits to see what a commit message typically looks like.
IsaacG commentedon Nov 2, 2026
And please don't use AI to rewrite it. Spend a minute and summarize the change yourself. It's a good skill to practice, and it shows respect for the time of everyone reading it.
Aksima commentedon Nov 2, 2026
I want to be respectful to the readers, so I go and study prior commits to decide on how commit message should look like.
Aksima commentedon Nov 2, 2026
The current commit message is:
Add a test to pig-latin exercise that reimplements test with whole phrase (uuid 44616581-5ce3-4a81-82d0-40c7ab13d2cf)
Examples of previous commits are:
One commit:
[resistor-color-tolerance] Correct tolerance in expected output: grey is 0.05% tolerance
reimplementskeyAnother commit:
state-of-tic-tac-toe: Add test cases for playing after a win
Add two new canonical test cases to verify that an error is thrown
when a player makes a move after the game has already been won:
After studying previous commits, I plan to modify my commit message to:
[pig-latin] Add test case for catching an invalid assumption that all words in a phrase are of same type. A discussion of new test case is here: https://forum.exercism.org/t/add-tests-to-pig-latin-exercise/95998/36
reimplementskeycommentskey with brief description of reason behind introduction of new testWhat do you think?
IsaacG commentedon Nov 2, 2026
Did you write that or did AI write that?
Aksima commentedon Nov 2, 2026
I wrote it by my own, since I am an author of pull request and prefer to explain it by myself, even if AI can write better commit message.
And I really want to learn, so don't hesitate to point to my mistakes, if any.
IsaacG commentedon Nov 2, 2026
This is a good start.
A discussion of new test case is here: https://forum.exercism.org/t/add-tests-to-pig-latin-exercise/95998/36can be simplified to[See forum discussion](https://forum.exercism.org/t/add-tests-to-pig-latin-exercise/95998/)reimplementsorcommentsin the commit message. People can see what is added by looking at the code. The commit should explain, at a high level, what changed and why. It should not repeat what is in the code.Aksima commentedon Nov 3, 2026
Updated message accordingly:
[pig-latin] Add test case for catching an invalid assumption that all words in a phrase are of same type.
See forum discussion
IsaacG commentedon Nov 3, 2026
That looks much better! The bullet isn't needed on the last line as there's only one entry. Otherwise, that looks great.
Aksima commentedon Nov 3, 2026
Managed to modify the commit message not only in discussion, but in pull request too.
IsaacG commentedon Nov 3, 2026
@Aksima I still see the old message at #2697
Aksima commentedon Nov 3, 2026
I probably made some mistake and the change is not complete. But first of all, how can I reproduce the issue? Since it shows new commit message at given link.
IsaacG commentedon Nov 3, 2026
Click the pencil icon next to the title to edit the title.
Click the
...andEditto edit the description.Aksima commentedon Nov 3, 2026
Successfully copied text from commits tab to conservation tab
IsaacG commentedon Nov 3, 2026
Nicely done! Thank you for your patience. PR merged.