-
-
Notifications
You must be signed in to change notification settings - Fork 196
fix pangram test for duplicate mixed-case chars #565
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Hi! Thanks for taking the time to open this PR.
That test case was implemented by exercism/problem-specifications#439, as a solution to the issue exercism/problem-specifications#266:
The implementation mentioned in exercism/kotlin#10 was the following: fun isPangram(sentence: String): Boolean {
return sentence
.filter { it.isLetter() }
.toList()
.distinct()
.count() >= 26
} ...which is very similar to your code: isPangram = (== 26) . length . nub . filter isAlpha
I agree that it is undesirable that the solution passes the test, but the test cases that we used in this exercise came from this file in the exercism/problem-specifications repository, which contains a pool of test cases that all languages can share. For that reason, it would be great if you could open an issue there, so that maintainers from other languages could discuss it, and the change would help more people. After the change is discussed and merged there, then we'll also change it here. 👍 |
Ready to go here. Can we ask that https://github.com/exercism/haskell/blob/master/exercises/pangram/package.yaml#L2 change to 1.1.0.3? |
3bc0549
to
37ed8ef
Compare
👍 have rebased and bumped version |
From what I can see, the last test case is inteded to catch incorrect programs such as this, which don't take into account different-cased duplicates: isPangram = (== 26) . length . nub . filter isAlpha However the above program passed the final test as the count of distinct upper and lower case characters is 27, rather than 26. This commit changes the test text to a non-pangram that has exactly 26 distinct upper and lower case characters, which causes the above, incorrect program to fail.
exercises/pangram/package.yaml
Outdated
@@ -1,5 +1,5 @@ | |||
name: pangram | |||
version: 1.0.0.2 | |||
version: 1.0.0.3 |
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.
first three digits signify x-common version we are following. Since we are following 1.1.0, please 1.1.0.3 not 1.0.0.3
I am sorry that we did not document this (#538)
also, I considered asking for a https://github.com/exercism/haskell#example-solution |
Very good, thanks. |
From what I can see, the last test case is inteded to catch incorrect
programs such as this, which don't take into account different-cased
duplicates:
However the above program passed the final test as the count of distinct
upper and lower case characters is 27, rather than 26.
This commit changes the test text to a non-pangram that has exactly 26
distinct upper and lower case characters, which causes the above,
incorrect program to fail.