Sha256: a059b436a02eae747e64848bed8d0eda311df0d9b0b373878dc5bb769e3f0528

Contents?: true

Size: 1.69 KB

Versions: 114

Compression:

Stored size: 1.69 KB

Contents

module Tests exposing (..)

import Test exposing (..)
import Expect
import Series exposing (slices)


tests : Test
tests =
    describe "Series"
        [ test "slices of one" <|
            \() ->
                Expect.equal (Ok [ [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ] ])
                    (slices 1 "01234")
        , skip <|
            test "slices of two" <|
                \() ->
                    Expect.equal (Ok [ [ 9, 7 ], [ 7, 8 ], [ 8, 6 ], [ 6, 7 ], [ 7, 5 ], [ 5, 6 ], [ 6, 4 ] ])
                        (slices 2 "97867564")
        , skip <|
            test "slices of three" <|
                \() ->
                    Expect.equal (Ok [ [ 9, 7, 8 ], [ 7, 8, 6 ], [ 8, 6, 7 ], [ 6, 7, 5 ], [ 7, 5, 6 ], [ 5, 6, 4 ] ])
                        (slices 3 "97867564")
        , skip <|
            test "slices of four" <|
                \() ->
                    Expect.equal (Ok [ [ 0, 1, 2, 3 ], [ 1, 2, 3, 4 ] ])
                        (slices 4 "01234")
        , skip <|
            test "slices of five" <|
                \() ->
                    Expect.equal (Ok [ [ 0, 1, 2, 3, 4 ] ])
                        (slices 5 "01234")
        , skip <|
            test "overly long slice" <|
                \() ->
                    Expect.equal (Ok [])
                        (slices 4 "012")
        , skip <|
            test "overly short slice" <|
                \() ->
                    Expect.equal (Err ("Invalid size: 0"))
                        (slices 0 "01234")
        , skip <|
            test "input has non numbers" <|
                \() ->
                    Expect.equal (Err "could not convert string 'a' to an Int")
                        (slices 2 "0123abc")
        ]

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
trackler-2.2.1.24 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.23 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.22 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.21 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.20 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.19 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.18 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.17 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.16 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.15 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.14 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.13 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.12 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.11 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.10 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.9 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.8 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.7 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.6 tracks/elm/exercises/series/tests/Tests.elm
trackler-2.2.1.5 tracks/elm/exercises/series/tests/Tests.elm