Sha256: a8e12ecb96da20acac1265a12a00ac7d7bbccdc2317f59e2409863d67f275381
Contents?: true
Size: 1.18 KB
Versions: 60
Compression:
Stored size: 1.18 KB
Contents
module Tests exposing (..) import Test exposing (..) import Expect import CollatzConjecture exposing (collatz) tests : Test tests = describe "CollatzConjecture tests" [ test "zero steps for one" <| \() -> Expect.equal (Ok 0) (collatz 1) -- Once you get the first test passing, remove the -- `skip <|` (just leave the comma) on the next -- lines to continue! , skip <| test "divide if even" <| \() -> Expect.equal (Ok 4) (collatz 16) , skip <| test "even and odd step" <| \() -> Expect.equal (Ok 9) (collatz 12) , skip <| test "Large number of even and odd step" <| \() -> Expect.equal (Ok 152) (collatz 1000000) , skip <| test "zero is an error" <| \() -> Expect.equal (Err "Only positive numbers are allowed") (collatz 0) , skip <| test "negative values is an error" <| \() -> Expect.equal (Err "Only positive numbers are allowed") (collatz -15) ]
Version data entries
60 entries across 60 versions & 1 rubygems