Skip to content

Commit

Permalink
acronym: upgrade to 1.7.0 (add extra test case) (#861)
Browse files Browse the repository at this point in the history
add underscore test case

fix the text example to pass the newly added test case

exercism/problem-specifications#1436
  • Loading branch information
sharno authored and sshine committed Oct 10, 2019
1 parent f88e6a4 commit 9252572
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exercises/acronym/examples/success-text/src/Acronym.hs
Expand Up @@ -10,6 +10,6 @@ abbreviate s = T.filter (/= ' ') $ T.zipWith sanitize (" " <> s) (s <> " ")

sanitize :: Char -> Char -> Char
sanitize a b
| (a == ' ' || a == '-') && isLetter b = toUpper b
| not (isLetter a) && a /= '\'' && isLetter b = toUpper b
| isLower a && isUpper b = b
| otherwise = ' '
2 changes: 1 addition & 1 deletion exercises/acronym/package.yaml
@@ -1,5 +1,5 @@
name: acronym
version: 1.6.0.10
version: 1.7.0.11

dependencies:
- base
Expand Down
4 changes: 4 additions & 0 deletions exercises/acronym/test/Tests.hs
Expand Up @@ -62,4 +62,8 @@ cases = [ Case { description = "basic"
, input = "Halley's Comet"
, expected = "HC"
}
, Case { description = "underscore emphasis"
, input = "The Road _Not_ Taken"
, expected = "TRNT"
}
]

0 comments on commit 9252572

Please sign in to comment.