/
Regressions.hs
38 lines (31 loc) · 929 Bytes
/
Regressions.hs
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
26
27
28
29
30
31
32
33
34
35
36
37
38
module Main where
import qualified Data.HashMap.Strict as HM
import Data.Maybe
import Test.HUnit (Assertion, assert)
import Test.Framework (Test, defaultMain)
import Test.Framework.Providers.HUnit (testCase)
issue32 :: Assertion
issue32 = assert $ isJust $ HM.lookup 7 m'
where
ns = [0..16] :: [Int]
m = HM.fromList (zip ns (repeat []))
m' = HM.delete 10 m
issue39 :: Assertion
issue39 = assert $ hm1 == hm2
where
hm1 = HM.fromList ([a, b] `zip` [1, 1 :: Int ..])
hm2 = HM.fromList ([b, a] `zip` [1, 1 :: Int ..])
a = (1, -1) :: (Int, Int)
b = (-1, 1) :: (Int, Int)
------------------------------------------------------------------------
-- * Test list
tests :: [Test]
tests =
[
testCase "issue32" issue32
, testCase "issue39" issue39
]
------------------------------------------------------------------------
-- * Test harness
main :: IO ()
main = defaultMain tests