mirror of
https://github.com/polysemy-research/polysemy.git
synced 2024-11-30 07:13:55 +03:00
82f86add29
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.
17 lines
366 B
Haskell
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!"
|
|
|