Skip to content

Commit

Permalink
pangram: fix test for duplicate mixed-case chars (#852)
Browse files Browse the repository at this point in the history
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:

```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.
  • Loading branch information
rsslldnphy authored and petertseng committed Jun 26, 2017
1 parent 15ea048 commit fba1aef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exercises/pangram/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"comments": [
"A pangram is a sentence using every letter of the alphabet at least once."
],
"version": "1.0.0",
"version": "1.1.0",
"cases": [
{
"description": "Check if the given string is an pangram",
Expand Down Expand Up @@ -62,7 +62,7 @@
{
"description": "upper and lower case versions of the same character should not be counted separately",
"property": "isPangram",
"input": "the quick brown fox jumped over the lazy FOX",
"input": "the quick brown fox jumps over with lazy FX",
"expected": false
}
]
Expand Down

0 comments on commit fba1aef

Please sign in to comment.