From 92525723605f1b6a69412bedb6e09918c93108eb Mon Sep 17 00:00:00 2001 From: Mohamed Elsharnouby Date: Thu, 10 Oct 2019 14:05:58 -0400 Subject: [PATCH] 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 --- exercises/acronym/examples/success-text/src/Acronym.hs | 2 +- exercises/acronym/package.yaml | 2 +- exercises/acronym/test/Tests.hs | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exercises/acronym/examples/success-text/src/Acronym.hs b/exercises/acronym/examples/success-text/src/Acronym.hs index 1f6cf8234..9d1f636c7 100644 --- a/exercises/acronym/examples/success-text/src/Acronym.hs +++ b/exercises/acronym/examples/success-text/src/Acronym.hs @@ -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 = ' ' diff --git a/exercises/acronym/package.yaml b/exercises/acronym/package.yaml index 168df980a..518126cc8 100644 --- a/exercises/acronym/package.yaml +++ b/exercises/acronym/package.yaml @@ -1,5 +1,5 @@ name: acronym -version: 1.6.0.10 +version: 1.7.0.11 dependencies: - base diff --git a/exercises/acronym/test/Tests.hs b/exercises/acronym/test/Tests.hs index 18ab64a8d..020fc7b3c 100644 --- a/exercises/acronym/test/Tests.hs +++ b/exercises/acronym/test/Tests.hs @@ -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" + } ]