exercism / elixir

Exercism exercises in Elixir.
https://exercism.org/tracks/elixir
MIT License
614 stars 397 forks source link

Pig Latin. Tests and Description seems to diverge #1491

Closed DerMolly closed 3 months ago

DerMolly commented 3 months ago

I just finished this task and it seems to me that there is divergence between the description and the tests.

E.g. 'x' and 'y', when followed by a consonant, are treated like a vowel word beginning with y, followed by another consonant (0.00ms) [L#112] wants the following to be true:

PigLatin.translate("yddria") == "yddriaay"

The only rules that I can see that mention y are

Rule 4 should not apply because there should be at least one consonant before the y to move it to the back and Rule 1 only mentions yt explicitly, but the test case want's us to handle yd the same way. From the text of the test I implemented it so that any y or x followed by any consonant would be left alone and just get the common suffix ay.

If I'm not mistaken either the test cases are wrong here or the text for Rule 1 should be something like

If a word begins with a vowel, or starts with "x" or "y" followed by an consonant, add an "ay" sound to the end of the word.

Or am I missing something?

jiegillet commented 3 months ago

Hi @DerMolly, thank you so much for the input I think you are correct. The exercise descriptions are standard across all tracks, so they are the source of truth and we can't touch them.

It looks like our test suite misunderstood some of the rules, or maybe they evolved over time, but really it's our fault for adding test cases that are not in the canonical data. I'll remove them.