Sha256: 33d13f60d6b0e2e9f367294eaa56cf11bb6c343a8bfc3cc7ea9cf31dbb156874
Contents?: true
Size: 1.06 KB
Versions: 131
Compression:
Stored size: 1.06 KB
Contents
module Test.Main where import Prelude import CollatzConjecture (collatz) import Control.Monad.Aff.AVar (AVAR) import Control.Monad.Eff (Eff) import Control.Monad.Eff.Console (CONSOLE) import Data.Maybe (Maybe(..)) import Test.Unit (TestSuite, suite, test) import Test.Unit.Assert as Assert import Test.Unit.Console (TESTOUTPUT) import Test.Unit.Main (runTest) main :: forall eff . Eff ( avar :: AVAR , console :: CONSOLE , testOutput :: TESTOUTPUT | eff ) Unit main = runTest suites suites :: forall e. TestSuite e suites = do suite "CollatzConjecture.collatz" do test "zero steps for one" do Assert.equal (Just 0) (collatz 1) test "divide if even" do Assert.equal (Just 4) (collatz 16) test "even and odd steps" do Assert.equal (Just 9) (collatz 12) test "Large number of even and odd steps" do Assert.equal (Just 152) (collatz 1000000) test "zero is an error" do Assert.equal Nothing (collatz 0) test "negative value is an error" do Assert.equal Nothing (collatz (-15))
Version data entries
131 entries across 131 versions & 1 rubygems