graphql-engine/server/src-test/Control/Monad/CircularSpec.hs
Samir Talwar f48c882521 server: Share tests between CircularT and MemoizeT.
This abstracts `CircularT`'s test cases to work against "any" memoizer, and then runs them against `MemoizeT` as well.

Surprisingly (or not), this works without issue; `MemoizeT` passes all tests with a couple of extra instances.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5780
GitOrigin-RevId: 461880caf9220dc3f52d622a22e8b8bcd594e404
2022-09-08 19:38:49 +00:00

16 lines
342 B
Haskell

{-# OPTIONS_GHC -Wno-orphans #-}
module Control.Monad.CircularSpec (spec) where
import Control.Monad.Circular
import Control.Monad.MemoizationSpecDefinition
import Hasura.Prelude
import Test.Hspec
instance Memoizer CircularT where
runMemoizer = runCircularT
memoize = const withCircular
spec :: Spec
spec = memoizationSpec @CircularT