1
exercism fetch elm say

tests/Tests.elm

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
module Tests exposing (..)

import Test exposing (..)
import Expect
import Say exposing (say, SayError(Negative, TooLarge))


tests : Test
tests =
    describe "Series"
        [ test "one" <|
            \() ->
                Expect.equal (Ok "one")
                    (say 1)
        , skip <|
            test "fourteen" <|
                \() ->
                    Expect.equal (Ok "fourteen")
                        (say 14)
        , skip <|
            test "twenty" <|
                \() ->
                    Expect.equal (Ok "twenty")
                        (say 20)
        , skip <|
            test "twenty-two" <|
                \() ->
                    Expect.equal (Ok "twenty-two")
                        (say 22)
        , skip <|
            test "one hundred" <|
                \() ->
                    Expect.equal (Ok "one hundred")
                        (say 100)
        , skip <|
            test "one hundred twenty" <|
                \() ->
                    Expect.equal (Ok "one hundred and twenty")
                        (say 120)
        , skip <|
            test "one hundred twenty-three" <|
                \() ->
                    Expect.equal (Ok "one hundred and twenty-three")
                        (say 123)
        , skip <|
            test "one thousand" <|
                \() ->
                    Expect.equal (Ok "one thousand")
                        (say 1000)
        , skip <|
            test "one thousand two hundred thirty-four" <|
                \() ->
                    Expect.equal (Ok "one thousand two hundred and thirty-four")
                        (say 1234)
        , skip <|
            test "one million" <|
                \() ->
                    Expect.equal (Ok "one million")
                        (say 1000000)
        , skip <|
            test "one million two" <|
                \() ->
                    Expect.equal (Ok "one million and two")
                        (say 1000002)
        , skip <|
            test "1002345" <|
                \() ->
                    Expect.equal (Ok "one million two thousand three hundred and forty-five")
                        (say 1002345)
        , skip <|
            test "one billion" <|
                \() ->
                    Expect.equal (Ok "one billion")
                        (say 1000000000)
        , skip <|
            test "number too large" <|
                \() ->
                    Expect.equal (Err TooLarge)
                        (say 10000000000000000)
        , skip <|
            test "negative number" <|
                \() ->
                    Expect.equal (Err Negative)
                        (say -42)
        , skip <|
            test "zero" <|
                \() ->
                    Expect.equal (Ok "zero")
                        (say 0)
        , skip <|
            test "987654321123" <|
                \() ->
                    Expect.equal
                        (Ok
                            ("nine hundred and eighty-seven billion "
                                ++ "six hundred and fifty-four million "
                                ++ "three hundred and twenty-one thousand "
                                ++ "one hundred and twenty-three"
                            )
                        )
                        (say 987654321123)
        ]

tests/elm-package.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
    "version": "3.0.0",
    "summary": "Exercism problems in Elm.",
    "repository": "https://github.com/exercism/elm.git",
    "license": "BSD3",
    "source-directories": [
        ".",
        ".."
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "elm-community/elm-test": "4.0.0 <= v < 5.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}