diff --git a/test/Spec.hs b/test/Spec.hs index a1a999d..a114364 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -3,15 +3,15 @@ import GHC.IO.Exception (ExitCode (..)) import Lib (add) import Matchers (shouldBe) -import Result (fromProp2, isSuccess) +import Result as Result import System.Exit (exitWith) import TestSuite (TestSuite (..), runTests) main :: IO () main = do addUnitExit <- runTestSuite addUnitSuite - addPropExit <- addPropSuite >>= runTestSuite - exitWith (max addUnitExit addPropExit) + -- addPropExit <- addPropSuite >>= runTestSuite + exitWith addUnitExit runTestSuite :: TestSuite -> IO ExitCode runTestSuite testSuite = @@ -21,7 +21,7 @@ runTestSuite testSuite = rs (TestSuite rs) -> rs - anyFailures = not . all isSuccess $ results + anyFailures = not . all Result.isSuccess $ results in do runTests testSuite pure $ if anyFailures then ExitFailure 1 else ExitSuccess @@ -34,16 +34,20 @@ addUnitSuite = [ add 3 4 `shouldBe` 7, add 5 9 `shouldBe` 14, add (-3) 9 `shouldBe` 6, - add (-3) 28 `shouldBe` 25 + add (-3) 28 `shouldBe` 25, + add 14 51 `shouldBe` 65, + add 23 55 `shouldBe` 78, + add 71 0 `shouldBe` 71, + add 2 9 `shouldBe` 11 ] } -addPropSuite :: IO TestSuite -addPropSuite = - do - result <- fromProp2 (\x y -> add x y `shouldBe` (x + y)) - pure $ - NamedTestSuite - { suiteName = "addition prop tests", - suite = [result] - } \ No newline at end of file +-- addPropSuite :: IO TestSuite +-- addPropSuite = +-- do +-- result <- Result.fromProp2 (\x y -> add x y `shouldBe` (x + y)) +-- pure $ +-- NamedTestSuite +-- { suiteName = "addition prop tests", +-- suite = [result] +-- } \ No newline at end of file