elm/exercises/leap/tests/Tests.elm
2017-05-28 08:14:40 +02:00

25 lines
782 B
Elm

module Tests exposing (..)
import Test exposing (..)
import Expect
import Leap
tests : Test
tests =
describe "Leap"
[ test "leap year" <|
\() -> Expect.equal True (Leap.isLeapYear 1996)
, test "non-leap year" <|
\() -> Expect.equal False (Leap.isLeapYear 1997)
, test "non-leap even year" <|
\() -> Expect.equal False (Leap.isLeapYear 1998)
, test "century" <|
\() -> Expect.equal False (Leap.isLeapYear 1900)
, test "second century" <|
\() -> Expect.equal False (Leap.isLeapYear 1800)
, test "fourth century" <|
\() -> Expect.equal True (Leap.isLeapYear 2400)
, test "y2k" <|
\() -> Expect.equal True (Leap.isLeapYear 2000)
]