Skip to content

Commit 9252572

Browse files
sharnosshine
authored andcommitted
acronym: upgrade to 1.7.0 (add extra test case) (#861)
add underscore test case fix the text example to pass the newly added test case exercism/problem-specifications#1436
1 parent f88e6a4 commit 9252572

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

exercises/acronym/examples/success-text/src/Acronym.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ abbreviate s = T.filter (/= ' ') $ T.zipWith sanitize (" " <> s) (s <> " ")
1010

1111
sanitize :: Char -> Char -> Char
1212
sanitize a b
13-
| (a == ' ' || a == '-') && isLetter b = toUpper b
13+
| not (isLetter a) && a /= '\'' && isLetter b = toUpper b
1414
| isLower a && isUpper b = b
1515
| otherwise = ' '

exercises/acronym/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: acronym
2-
version: 1.6.0.10
2+
version: 1.7.0.11
33

44
dependencies:
55
- base

exercises/acronym/test/Tests.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@ cases = [ Case { description = "basic"
6262
, input = "Halley's Comet"
6363
, expected = "HC"
6464
}
65+
, Case { description = "underscore emphasis"
66+
, input = "The Road _Not_ Taken"
67+
, expected = "TRNT"
68+
}
6569
]

0 commit comments

Comments
 (0)