Sha256: 36e7241c7b0dd64b9f3caff9d2477fd5d4190ef4b5b6b1c88cd37a65c12928be

Contents?: true

Size: 1.56 KB

Versions: 188

Compression:

Stored size: 1.56 KB

Contents

module Tests exposing (..)

import Expect
import Grains exposing (square)
import Json.Encode exposing (Value)
import Test exposing (..)


tests : Test
tests =
    describe "Grains"
        [ describe "square"
            [ test "of 1" <|
                \() -> Expect.equal (Just 1) (square 1)
            , skip <|
                test "of 2" <|
                    \() -> Expect.equal (Just 2) (square 2)
            , skip <|
                test "of 3" <|
                    \() -> Expect.equal (Just 4) (square 3)
            , skip <|
                test "of 4" <|
                    \() -> Expect.equal (Just 8) (square 4)
            , skip <|
                test "of 16" <|
                    \() -> Expect.equal (Just 32768) (square 16)
            , skip <|
                test "of 32" <|
                    \() -> Expect.equal (Just 2147483648) (square 32)
            , skip <|
                test "square 0 raises an exception" <|
                    \() -> Expect.equal Nothing (square 0)
            , skip <|
                test "negative square raises an exception" <|
                    \() -> Expect.equal Nothing (square -1)

            {-
               Where are the bigger test values?!? Because Javascript's numbers
               can't represent values higher than `Number.MAX_SAFE_INTEGER`
               (i.e. 9007199254740991), we chose to exclude these final values
               to avoid the weirdness. A bit more information can be found
               here: https://github.com/elm-lang/elm-compiler/issues/1246
            -}
            ]
        ]

Version data entries

188 entries across 188 versions & 1 rubygems

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