diff --git a/test/Spec.hs b/test/Spec.hs index c51ffc8..0724824 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -13,22 +13,17 @@ addOne = (+ 1) add :: Int -> Int -> Int add x y = x + y -concat3 :: String -> String -> String -> String -concat3 x y z = x ++ y ++ z +compose0 :: Int -> String +compose0 = toString .**. addOne + +compose1 :: Int -> Int -> String +compose1 = toString .**. add main :: IO () main = hspec $ do describe "Variadic composition" $ do it "works with single argument functions" $ do - (toString .**. addOne) 5 `shouldBe` "6" + compose0 5 `shouldBe` "6" it "works with two argument functions" $ do - (toString .**. add) 1 2 `shouldBe` "3" - - it "works with three argument functions" $ do - (toString .**. concat3) "a" "b" "c" `shouldBe` "abc" - - it "maintains function behavior" $ do - let f = toString .**. addOne - let g = toString . addOne - f 10 `shouldBe` g 10 \ No newline at end of file + compose1 1 2 `shouldBe` "3"