Sha256: f80803d7840f116792d9a52238683e2d1cd3b21ce2510808c59274a3091d1390

Contents?: true

Size: 1.18 KB

Versions: 29

Compression:

Stored size: 1.18 KB

Contents

module Tests exposing (..)

import Test exposing (..)
import Expect
import Date
import Gigasecond exposing (add)


tests : Test
tests =
    describe "Gigasecond"
        [ describe "add"
            [ test "2011-04-25" <|
                \() ->
                    Expect.equal (date "2043-01-01T01:46:40") (Gigasecond.add (date "2011-04-25"))
            , test "1977-06-13" <|
                \() ->
                    Expect.equal (date "2009-02-19T01:46:40") (Gigasecond.add (date "1977-06-13"))
            , test "1959-07-19" <|
                \() ->
                    Expect.equal (date "1991-03-27T01:46:40") (Gigasecond.add (date "1959-07-19"))
            , test "full time specified" <|
                \() ->
                    Expect.equal (date "2046-10-02T23:46:40") (Gigasecond.add (date "2015-01-24T22:00:00"))
            , test "full time with day roll-over" <|
                \() ->
                    Expect.equal (date "2046-10-03T01:46:39") (Gigasecond.add (date "2015-01-24T23:59:59"))
            ]
        ]


date : String -> Date.Date
date input =
    case Date.fromString input of
        Ok date ->
            date

        Err reason ->
            Debug.crash reason

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
trackler-2.1.0.53 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.52 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.51 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.50 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.49 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.48 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.47 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.46 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.45 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.44 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.43 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.42 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.41 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.40 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.39 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.38 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.37 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.36 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.34 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.1.0.33 tracks/elm/exercises/gigasecond/tests/Tests.elm