diff --git a/sum-of-multiples/example.hs b/sum-of-multiples/example.hs index 3a96cc625..cf920ec0d 100644 --- a/sum-of-multiples/example.hs +++ b/sum-of-multiples/example.hs @@ -1,7 +1,4 @@ -module SumOfMultiples (sumOfMultiples, sumOfMultiplesDefault) where - -sumOfMultiplesDefault :: Int -> Int -sumOfMultiplesDefault = sumOfMultiples [3, 5] +module SumOfMultiples (sumOfMultiples) where sumOfMultiples :: [Int] -> Int -> Int sumOfMultiples targets upperBound = sum (filter f [1..upperBound-1]) diff --git a/sum-of-multiples/sum-of-multiples_test.hs b/sum-of-multiples/sum-of-multiples_test.hs index 73f4950c6..c4ff064b8 100644 --- a/sum-of-multiples/sum-of-multiples_test.hs +++ b/sum-of-multiples/sum-of-multiples_test.hs @@ -1,6 +1,6 @@ import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import System.Exit (ExitCode(..), exitWith) -import SumOfMultiples (sumOfMultiples, sumOfMultiplesDefault) +import SumOfMultiples (sumOfMultiples) exitProperly :: IO Counts -> IO () exitProperly m = do @@ -18,13 +18,13 @@ main = exitProperly $ runTestTT $ TestList sumOfMultiplesTests :: [Test] sumOfMultiplesTests = [ testCase "1" $ - 0 @=? sumOfMultiplesDefault 1 + 0 @=? sumOfMultiples [3, 5] 1 , testCase "4" $ - 3 @=? sumOfMultiplesDefault 4 + 3 @=? sumOfMultiples [3, 5] 4 , testCase "10" $ - 23 @=? sumOfMultiplesDefault 10 + 23 @=? sumOfMultiples [3, 5] 10 , testCase "1000" $ - 233168 @=? sumOfMultiplesDefault 1000 + 233168 @=? sumOfMultiples [3, 5] 1000 , testCase "[7, 13, 17] 20" $ 51 @=? sumOfMultiples [7, 13, 17] 20 , testCase "[4, 6] 15" $