Sha256: 1ddda455769d96e6d3932990c3e67c84ea75e8505339198178b12fcb0f3d481b

Contents?: true

Size: 1.16 KB

Versions: 141

Compression:

Stored size: 1.16 KB

Contents

port module Main exposing (..)

import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
import SpaceAge exposing (Planet(..), ageOn)


tests : Test
tests =
    describe "SpaceAge"
        [ test "age in earth years" <|
            \() -> Expect.equal 32 (round (ageOn Earth 1000000000))
        , test "age in mercury years" <|
            \() -> Expect.equal 281 (round (ageOn Mercury 2134835688))
        , test "age in venus years" <|
            \() -> Expect.equal 10 (round (ageOn Venus 189839836))
        , test "age on mars" <|
            \() -> Expect.equal 39 (round (ageOn Mars 2329871239))
        , test "age on jupiter" <|
            \() -> Expect.equal 2 (round (ageOn Jupiter 901876382))
        , test "age on saturn" <|
            \() -> Expect.equal 3 (round (ageOn Saturn 3000000000))
        , test "age on uranus" <|
            \() -> Expect.equal 1 (round (ageOn Uranus 3210123456))
        , test "age on neptune" <|
            \() -> Expect.equal 2 (round (ageOn Neptune 8210123456))
        ]


main : TestProgram
main =
    run emit tests


port emit : ( String, Value ) -> Cmd msg

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.1.0.23 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.22 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.21 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.20 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.19 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.18 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.17 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.16 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.15 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.14 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.13 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.12 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.11 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.10 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.9 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.8 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.7 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.6 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.5 tracks/elm/exercises/space-age/Tests.elm
trackler-2.1.0.4 tracks/elm/exercises/space-age/Tests.elm