Sha256: 42b029dc35fee3b9dc5325235d506b38bb1106f34cce0975f935b62d6a007aa6

Contents?: true

Size: 1.3 KB

Versions: 74

Compression:

Stored size: 1.3 KB

Contents

module Tests exposing (..)

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


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"))
            , skip <|
                test "1977-06-13" <|
                    \() ->
                        Expect.equal (date "2009-02-19T01:46:40") (Gigasecond.add (date "1977-06-13"))
            , skip <|
                test "1959-07-19" <|
                    \() ->
                        Expect.equal (date "1991-03-27T01:46:40") (Gigasecond.add (date "1959-07-19"))
            , skip <|
                test "full time specified" <|
                    \() ->
                        Expect.equal (date "2046-10-02T23:46:40") (Gigasecond.add (date "2015-01-24T22:00:00"))
            , skip <|
                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

74 entries across 74 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.179 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.178 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.177 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.176 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.175 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.174 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.173 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.172 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.171 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.170 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.169 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.167 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.166 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.165 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.164 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.163 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.162 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.161 tracks/elm/exercises/gigasecond/tests/Tests.elm
trackler-2.2.1.160 tracks/elm/exercises/gigasecond/tests/Tests.elm