2016-03-17 01:38:35 +00:00
|
|
|
module Main (..) where
|
2015-10-13 18:23:46 +00:00
|
|
|
|
2016-03-17 01:38:35 +00:00
|
|
|
import Task
|
|
|
|
import Console
|
|
|
|
import ElmTest exposing (..)
|
2015-10-13 18:23:46 +00:00
|
|
|
|
2016-03-17 01:38:35 +00:00
|
|
|
import SumOfMultiples exposing (sumOfMultiples)
|
2015-10-13 18:23:46 +00:00
|
|
|
|
|
|
|
tests : Test
|
|
|
|
tests = suite "Sum Of Multiples Test Suite"
|
|
|
|
[ test "[3, 5] 15" (assertEqual 45 (sumOfMultiples [3, 5] 15)),
|
|
|
|
test "[7, 13, 17] 20" (assertEqual 51 (sumOfMultiples [7, 13, 17] 20)),
|
|
|
|
test "[4, 6] 15" (assertEqual 30 (sumOfMultiples [4, 6] 15)),
|
|
|
|
test "[5, 6, 8] 150" (assertEqual 4419 (sumOfMultiples [5, 6, 8] 150)),
|
|
|
|
test "[43, 47] 10000" (assertEqual 2203160 (sumOfMultiples [43, 47] 10000)),
|
|
|
|
test "[5, 25] 51" (assertEqual 275 (sumOfMultiples [5, 25] 51))
|
|
|
|
|
|
|
|
]
|
|
|
|
|
2016-03-17 01:38:35 +00:00
|
|
|
port runner : Signal (Task.Task x ())
|
|
|
|
port runner =
|
|
|
|
Console.run (consoleRunner tests)
|
|
|
|
|