diff --git a/tests/Tests.hs b/tests/Tests.hs index 128147d..e512107 100644 --- a/tests/Tests.hs +++ b/tests/Tests.hs @@ -104,7 +104,7 @@ readerTests = testGroup "Reader tests" [ testProperty "Reader passes along environment: n + x" (\n x -> testReader n x == n + x) , testProperty "Multiple readers work" - (\f n -> testMultiReader f n == ((f + 2.0) + fromIntegral (n + 1))) + (\i n -> testMultiReader i n == ((i + 2) + fromIntegral (n + 1))) , testProperty "Local injects into env" (\env inc -> testLocal env inc == 2*(env+1) + inc) ] diff --git a/tests/Tests/Reader.hs b/tests/Tests/Reader.hs index 74525df..eb186d7 100644 --- a/tests/Tests/Reader.hs +++ b/tests/Tests/Reader.hs @@ -28,12 +28,12 @@ t1rr' = run t1 arising from a use of `t1' -} -testMultiReader :: Float -> Int -> Float -testMultiReader f n = run . flip runReader f . flip runReader n $ t2 +testMultiReader :: Integer -> Int -> Integer +testMultiReader i n = run . flip runReader i . flip runReader n $ t2 where t2 = do v1 <- ask v2 <- ask - return $ fromIntegral (v1 + (1::Int)) + (v2 + (2::Float)) + return $ fromIntegral (v1 + (1::Int)) + (v2 + (2::Integer)) -- The opposite order of layers {- If we mess up, we get an error