1
exercism fetch racket acronym

acronym-test.rkt

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#lang racket/base

(require "acronym.rkt")

(module+ test
  (require rackunit rackunit/text-ui)

  (define suite
    (test-suite
     "acronym tests"

     (test-equal? "basic"
                  (acronym "Portable Network Graphics")
                  "PNG")

     (test-equal? "lowercase words"
                  (acronym "Ruby on Rails")
                  "ROR")

     (test-equal? "camelcase"
                  (acronym "HyperText Markup Language")
                  "HTML")

     (test-equal? "punctuation"
                  (acronym "First In, First Out")
                  "FIFO")

     (test-equal? "all caps words"
                  (acronym "PHP: Hypertext Preprocessor")
                  "PHP")

     (test-equal? "non-acronym all caps word"
                  (acronym "GNU Image Manipulation Program")
                  "GIMP")

     (test-equal? "hyphenated"
                  (acronym "Complementary metal-oxide semiconductor")
                  "CMOS")))

  (run-tests suite))