Skip to content
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

fix pangram test for duplicate mixed-case chars #852

Merged
merged 1 commit into from
Jun 26, 2017

Conversation

rsslldnphy
Copy link
Contributor

@rsslldnphy rsslldnphy commented Jun 25, 2017

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.

Similar incorrect programs that checked if the count of distinct letters was >=, rather than exactly = to 26, would have correctly failed the existing test.

@rsslldnphy
Copy link
Contributor Author

Related, in the Haskell track (where I spotted this): exercism/haskell#565

@petertseng
Copy link
Member

In my review:

  • I verified that the proposed case has exactly 26 letters between uppercased and lowercased letters.
  • I agree that it is better to have exactly 26 letters, not 27, and thus this case is an improvement over the existing one.
  • I verified that the proposed case is not a pangram (it has 24 letters).

Please change the minor version, as https://github.com/exercism/problem-specifications#minor-version-changes

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:

```haskell
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.
@rsslldnphy
Copy link
Contributor Author

👍, I have added a version bump to the commit.

@petertseng petertseng merged commit fba1aef into exercism:master Jun 26, 2017
@petertseng
Copy link
Member

Very good, thanks!

@rsslldnphy rsslldnphy deleted the pangram-test-fix branch June 27, 2017 21:17
petertseng pushed a commit to exercism/haskell that referenced this pull request Jun 28, 2017
From what I can see, the last test case is intended 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.

As in exercism/problem-specifications#852
kotp added a commit to exercism/ruby that referenced this pull request Aug 27, 2017
emcoding pushed a commit that referenced this pull request Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants