forked from exercism/lfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacronym-tests.lfe
26 lines (21 loc) · 1.04 KB
/
acronym-tests.lfe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(defmodule acronym-tests
(behaviour ltest-unit)
(export all))
(include-lib "ltest/include/ltest-macros.lfe")
(deftest no-allergies-at-all (is-equal () (allergies:allergies 0)))
(defun acronyms_test_ ()
(lists:map #'make-test/1 (cases)))
(defun make-test
(((tuple description input expected))
(tuple description (lambda () (is-equal expected (acronym:abbreviate input))))))
(defun cases ()
(list
(tuple "basic" "Portable Network Graphics" "PNG")
(tuple "lowercase words" "Ruby on Rails" "ROR")
(tuple "punctuation" "First In, First Out" "FIFO")
(tuple "all caps word" "GNU Image Manipulation Program" "GIMP")
(tuple "punctuation without whitespace" "Complementary metal-oxide semiconductor" "CMOS")
(tuple "very long abbreviation" "Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me" "ROTFLSHTMDCOALM")
(tuple "consecutive delimiters" "Something - I made up from thin air" "SIMUFTA")
(tuple "apostrophes" "Halley's Comet" "HC")
(tuple "underscore emphasis" "The Road _Not_ Taken" "TRNT")))