Sha256: 824783e7fbd76764c54961aad5295e2b635e97ac9c2f367581a8703afa2b3778

Contents?: true

Size: 1.3 KB

Versions: 114

Compression:

Stored size: 1.3 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"))
            , 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

114 entries across 114 versions & 1 rubygems

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