-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.hs
More file actions
25 lines (20 loc) · 668 Bytes
/
Test.hs
File metadata and controls
25 lines (20 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Main where
import Test.Framework (defaultMain, testGroup, Test)
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test)
import FizzBuzz (fizzbuzz)
fizzbuzzSuite :: Test
fizzbuzzSuite = testGroup "fizzbuzz calls"
[ testCase "1" (testFizzbuzz 1 "1")
, testCase "2" (testFizzbuzz 2 "2")
, testCase "3" (testFizzbuzz 3 "Fizz")
, testCase "4" (testFizzbuzz 4 "4")
, testCase "5" (testFizzbuzz 5 "Buzz")
, testCase "15" (testFizzbuzz 15 "FizzBuzz")
]
testFizzbuzz :: Integer -> String -> Assertion
testFizzbuzz argument expected = expected @=? fizzbuzz argument
main :: IO ()
main = defaultMain
[ fizzbuzzSuite
]