程序代写 module ReaderSpec

module ReaderSpec

import Test.Hspec
import Test.HUnit

Copyright By PowCoder代写 加微信 powcoder

import Control.Monad.Reader

import qualified Reader
import Reader (Config (Cfg))

testCompute :: (Int -> Config -> Int) -> Spec
testCompute compute =
it “correctly computes bogus” $ do
compute 5 (Cfg 4 6) @?= 3
compute 20 (Cfg 41 56) @?= 5
compute 80 (Cfg 18 5) @?= 93
compute 88 (Cfg 64 15) @?= 137

tests :: Spec
tests = do
let unwrap rd i cfg = runReader (rd i) cfg
describe “compute” $ testCompute Reader.compute
describe “compute'” $ testCompute $ unwrap Reader.compute’
describe “compute”” $ testCompute $ unwrap Reader.compute”

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com