polysemy/test/HigherOrderSpec.hs
Sandy Maguire 82f86add29
Custom type error testing (#113)
This PR adds doctests allowing us to write tests for the custom type errors. Having this stuff reified in the test suite means we can iterate on the implementations and give much better QA.
2019-06-15 20:04:11 -04:00

17 lines
366 B
Haskell

module HigherOrderSpec where
import Polysemy
import Polysemy.Reader
import Test.Hspec
spec :: Spec
spec = parallel $ describe "Reader local" $ do
it "should nest with itself" $ do
let foo = run . runReader "hello" $ do
local (++ " world") $ do
local (++ "!") $ do
ask
foo `shouldBe` "hello world!"