File: NoFieldSelectorsSpec.hs

package info (click to toggle)
haskell-persistent 2.14.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,120 kB
  • sloc: haskell: 12,767; makefile: 3
file content (44 lines) | stat: -rw-r--r-- 915 bytes parent folder | download
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
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 902
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE DuplicateRecordFields #-}
#endif
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}

module Database.Persist.TH.NoFieldSelectorsSpec where

import TemplateTestImports

#if __GLASGOW_HASKELL__ >= 902

mkPersist sqlSettings {mpsFieldLabelModifier = const id} [persistLowerCase|
User
    ident Text
    name Text
    Primary ident
    team TeamId
    type Text

Team
    name Text
|]

spec :: Spec
spec = it "compiles" True

#else

spec :: Spec
spec = do
    it "only works with GHC 9.2 or greater" $ do
        pendingWith "only works with GHC 9.2 or greater"

#endif