1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
{-# OPTIONS_GHC -Wno-unused-local-binds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Database.Persist.TH.NestedSymbolsInTypeSpec where
import Data.Map
import Database.Persist.TH.NestedSymbolsInTypeSpecImports
import TemplateTestImports
mkPersist sqlSettings [persistLowerCase|
PathEntitySimple
readOnly (Maybe (SomePath ReadOnly))
PathEntityNested
paths (Maybe (Map Text [SomePath ReadWrite]))
|]
spec :: Spec
spec = describe "NestedSymbolsInType" $ do
it "should support nested parens" $ do
let mkPathEntitySimple :: Maybe (SomePath ReadOnly) -> PathEntitySimple
mkPathEntitySimple = PathEntitySimple
pathEntitySimpleReadOnly' :: PathEntitySimple -> Maybe (SomePath ReadOnly)
pathEntitySimpleReadOnly' = pathEntitySimpleReadOnly
compiles
it "should support deeply nested parens + square brackets" $ do
let mkPathEntityNested :: Maybe (Map Text [SomePath ReadWrite]) -> PathEntityNested
mkPathEntityNested = PathEntityNested
pathEntityNestedPaths' :: PathEntityNested -> Maybe (Map Text [SomePath ReadWrite])
pathEntityNestedPaths' = pathEntityNestedPaths
compiles
compiles :: Expectation
compiles = True `shouldBe` True
|