diff --git a/config.json b/config.json index 31c1eb7..25fe8b0 100644 --- a/config.json +++ b/config.json @@ -16,9 +16,15 @@ "highlightjs_language": "haskell" }, "files": { - "solution": ["%{pascal_slug}.roc"], - "test": ["%{kebab_slug}-test.roc"], - "example": [".meta/Example.roc"] + "solution": [ + "%{pascal_slug}.roc" + ], + "test": [ + "%{kebab_slug}-test.roc" + ], + "example": [ + ".meta/Example.roc" + ] }, "exercises": { "practice": [ diff --git a/exercises/practice/acronym/.meta/Example.roc b/exercises/practice/acronym/.meta/Example.roc index 366ba14..3575d0b 100644 --- a/exercises/practice/acronym/.meta/Example.roc +++ b/exercises/practice/acronym/.meta/Example.roc @@ -27,6 +27,6 @@ isLetter = \byte -> capitalize : U8 -> U8 capitalize = \byte -> if 'a' <= byte && byte <= 'z' then - byte - 32 + byte - 'a' + 'A' else byte diff --git a/exercises/practice/acronym/.meta/template.j2 b/exercises/practice/acronym/.meta/template.j2 index 4762bae..31e5cde 100644 --- a/exercises/practice/acronym/.meta/template.j2 +++ b/exercises/practice/acronym/.meta/template.j2 @@ -7,95 +7,7 @@ import {{ exercise | to_pascal }} exposing [abbreviate] {% for case in cases -%} # {{ case["description"] }} expect - result = {{ case["property"] | to_camel }} "{{ case["input"]["phrase"] }}" + result = {{ case["property"] | to_camel }} {{ case["input"]["phrase"] | to_roc }} result == "{{ case["expected"] }}" {% endfor %} - -# acronym/canonical-data.json -{ - "exercise": "acronym", - "cases": [ - { - "uuid": "1e22cceb-c5e4-4562-9afe-aef07ad1eaf4", - "description": "basic", - "property": "abbreviate", - "input": { - "phrase": "Portable Network Graphics" - }, - "expected": "PNG" - }, - { - "uuid": "79ae3889-a5c0-4b01-baf0-232d31180c08", - "description": "lowercase words", - "property": "abbreviate", - "input": { - "phrase": "Ruby on Rails" - }, - "expected": "ROR" - }, - { - "uuid": "ec7000a7-3931-4a17-890e-33ca2073a548", - "description": "punctuation", - "property": "abbreviate", - "input": { - "phrase": "First In, First Out" - }, - "expected": "FIFO" - }, - { - "uuid": "32dd261c-0c92-469a-9c5c-b192e94a63b0", - "description": "all caps word", - "property": "abbreviate", - "input": { - "phrase": "GNU Image Manipulation Program" - }, - "expected": "GIMP" - }, - { - "uuid": "ae2ac9fa-a606-4d05-8244-3bcc4659c1d4", - "description": "punctuation without whitespace", - "property": "abbreviate", - "input": { - "phrase": "Complementary metal-oxide semiconductor" - }, - "expected": "CMOS" - }, - { - "uuid": "0e4b1e7c-1a6d-48fb-81a7-bf65eb9e69f9", - "description": "very long abbreviation", - "property": "abbreviate", - "input": { - "phrase": "Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me" - }, - "expected": "ROTFLSHTMDCOALM" - }, - { - "uuid": "6a078f49-c68d-4b7b-89af-33a1a98c28cc", - "description": "consecutive delimiters", - "property": "abbreviate", - "input": { - "phrase": "Something - I made up from thin air" - }, - "expected": "SIMUFTA" - }, - { - "uuid": "5118b4b1-4572-434c-8d57-5b762e57973e", - "description": "apostrophes", - "property": "abbreviate", - "input": { - "phrase": "Halley's Comet" - }, - "expected": "HC" - }, - { - "uuid": "adc12eab-ec2d-414f-b48c-66a4fc06cdef", - "description": "underscore emphasis", - "property": "abbreviate", - "input": { - "phrase": "The Road _Not_ Taken" - }, - "expected": "TRNT" - } - ] -} diff --git a/exercises/practice/acronym/acronym-test.roc b/exercises/practice/acronym/acronym-test.roc index 9392801..c114051 100644 --- a/exercises/practice/acronym/acronym-test.roc +++ b/exercises/practice/acronym/acronym-test.roc @@ -56,3 +56,4 @@ expect expect result = abbreviate "The Road _Not_ Taken" result == "TRNT" +