New "qu" test for Pig Latin

I’m seeing some solutions that do this:

  • if word starts with a vowel or “xr” or “yt”, then return word + “ay”
  • else if word contains “qu” then …

Those solutions will fail for a word like “liquid”

Can I add a canonical test like this

{
  "uuid": "...",
  "description": "word containing qu but with a vowel before",
  "property": "translate",
  "input": {
    "phrase": "liquid"
  },
  "expected": "iquidlay"
}
5 Likes

Sounds good to me

1 Like

I see this has been added to the trunk exercism branch now (New "qu" test for Pig Latin (#2507) · exercism/problem-specifications@d11557d · GitHub) but this still isn’t tested for when you run pig-latin. At least on Python and PHP.

There’s a similar issue with ‘y’, though it is more niche, and which can be solved by adding the test word ‘mystery’. I’m unsure whether to discuss a pull request for that though, when this addition didn’t actually work yet.
Do we just need to wait for some automatic periodic build?

This is the MR I was considering, I hope this isn’t a bother:

Have you seen many solutions where “mystery” would produce “ymysteray”?

“Do we just need to wait for some automatic periodic build” – no, the track maintainers have to act to sync the exercises in their tracks.

Not many. I was reviewing someone’s code that should have failed in a couple of different ways, but passed all the tests. This is one of the cases that failed his code. (Your “liquid” also failed, but it’s not in the test set yet.)
It’s actually kind of spectacular that the code I reviewed worked for “therapy” at all.

Looking through the most recent 10 solutions, 2 of them I think are bugged. Those do fail ‘liquid’ I think. I’m having a hard time parsing this code in my mind, so I can’t read many more than 10.

@petercordia :wave:

For the Python track, we don’t sync to problem specs more than once a month. It’s not a lot of effort – but it is effort, so we try to group the changes we pull in.

We have not done the sync yet for this month, and might wait until January some time, since we’re also doing some tooling and other maintenance at the moment.

Beyond that, track maintainers also have the option of rejecting a test case if they feel that it doesn’t fit with language idioms or other objectives on the track.

3 Likes

Fair. A de facto waiting period of 1-2 months isn’t too bad. It was confusing for me, but I’ll understand the situation next time.

I don’t see how an english language word to the pig-latin test cases could clash with any language idioms or other objectives, but I respect the maintainers authority to reject test cases for unknown reasons. It might require effort or other resources.

Trying to think of this exersise more systematically, I believe one of these words would be most likely to expose flaws in ‘solutions’: RegEx Dictionary Word Search .*y.*qu.*.

Do note, the tests aren’t intended to be exhaustive of every edge case. See Suggesting Exercise Improvements | Exercism's Docs

2 Likes