diff --git a/test/Language/Lambda/EvalSpec.hs b/test/Language/Lambda/EvalSpec.hs index e6f247f3c3cb3153a8eca840566500e2a62e0ca8..bf7e41eea3609a34c6f55039cf911a2a90762b79 100644 --- a/test/Language/Lambda/EvalSpec.hs +++ b/test/Language/Lambda/EvalSpec.hs @@ -33,7 +33,7 @@ spec = do it "reduces simple applications" $ do let e1 = Abs "x" (Var "x") - e2 = (Var "y") + e2 = Var "y" betaReduce' e1 e2 `shouldBe` Var "y" it "reduces nested abstractions" $ do @@ -97,14 +97,14 @@ spec = do etaConvert expr `shouldBe` expr describe "freeVarsOf" $ do - it "Returns simple vars" $ do + it "Returns simple vars" $ freeVarsOf (Var "x") `shouldBe` ["x"] - it "Does not return bound vars" $ do + it "Does not return bound vars" $ freeVarsOf (Abs "x" (Var "x")) `shouldBe` [] - it "Returns nested simple vars" $ do + it "Returns nested simple vars" $ freeVarsOf (Abs "x" (Var "y")) `shouldBe` ["y"] - it "Returns applied simple vars" $ do + it "Returns applied simple vars" $ freeVarsOf (App (Var "x") (Var "y")) `shouldBe` ["x", "y"] diff --git a/test/Language/LambdaSpec.hs b/test/Language/LambdaSpec.hs index 36935c9eafc2654da5645e14ccfd1c22a38a9a93..44cc67c3532f10f694a05ac5cfd84e3c2adb4887 100644 --- a/test/Language/LambdaSpec.hs +++ b/test/Language/LambdaSpec.hs @@ -12,19 +12,19 @@ spec = do evalString "\\x. x" `shouldBe` Right (Abs "x" (Var "x")) evalString "f y" `shouldBe` Right (App (Var "f") (Var "y")) - it "reduces simple applications" $ do + it "reduces simple applications" $ evalString "(\\x .x) y" `shouldBe` Right (Var "y") - it "reduces applications with nested redexes" $ do + it "reduces applications with nested redexes" $ evalString "(\\f x. f x) (\\y. y)" `shouldBe` Right (Abs "x" (Var "x")) describe "uniques" $ do let alphabet = reverse ['a'..'z'] len = length alphabet - it "starts with plain alphabet" $ do + it "starts with plain alphabet" $ take len uniques `shouldBe` map (:[]) alphabet - it "adds index afterwards" $ do + it "adds index afterwards" $ take len (drop len uniques) `shouldBe` map (:['0']) alphabet