
7 Jul
2015
7 Jul
'15
6:21 a.m.
interestingly, the below test fails. May I ask: If "case" a1 is not the same as "where" a1, what is its value? Why does x=1 match against a1? note: result1 indent is aligned with a1 on the previous line ------ test module TestCase where import Test.Hspec main::IO() main = hspec $ do describe "TestCase" $ do it "case 1 - pass" $ do result1 1 `shouldBe` "one" it "case 2 - fail" $ do result1 2 `shouldBe` "two" where a1 = 2 result1 x = case x of a1 -> "one" 2 -> "two"