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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
{-# LANGUAGE CPP #-}
{-|
Module: Spec.Data.TupleSpec
Copyright: (C) 2014-2017 Ryan Scott
License: BSD-style (see the file LICENSE)
Maintainer: Ryan Scott
Stability: Provisional
Portability: GHC
@hspec@ tests for tuple types.
-}
module Spec.Data.TupleSpec (main, spec) where
import Data.Proxy.Compat (Proxy(..))
import Generics.Deriving.Instances ()
#if MIN_VERSION_ghc_prim(0,7,0)
import GHC.Tuple (Solo)
#endif
import Instances.Data.Tuple ()
import Spec.Utils (matchesTextShowSpec, matchesTextShow1Spec,
genericTextShowSpec, genericTextShow1Spec)
import Test.Hspec (Spec, describe, hspec, parallel)
import Test.QuickCheck.Instances ()
main :: IO ()
main = hspec spec
spec :: Spec
spec = parallel $ do
describe "()" $ do
let p :: Proxy ()
p = Proxy
matchesTextShowSpec p
genericTextShowSpec p
describe "(Int, Int)" $ do
let p :: Proxy (Int, Int)
p = Proxy
matchesTextShow1Spec p
genericTextShowSpec p
genericTextShow1Spec p
describe "(Int, Int, Int)" $ do
let p :: Proxy (Int, Int, Int)
p = Proxy
matchesTextShowSpec p
genericTextShowSpec p
genericTextShow1Spec p
describe "(Int, Int, Int, Int)" $ do
let p :: Proxy (Int, Int, Int, Int)
p = Proxy
matchesTextShowSpec p
genericTextShowSpec p
genericTextShow1Spec p
describe "(Int, Int, Int, Int, Int)" $ do
let p :: Proxy (Int, Int, Int, Int, Int)
p = Proxy
matchesTextShowSpec p
genericTextShowSpec p
genericTextShow1Spec p
describe "(Int, Int, Int, Int, Int, Int)" $ do
let p :: Proxy (Int, Int, Int, Int, Int, Int)
p = Proxy
matchesTextShowSpec p
genericTextShowSpec p
genericTextShow1Spec p
describe "(Int, Int, Int, Int, Int, Int, Int)" $ do
let p :: Proxy (Int, Int, Int, Int, Int, Int, Int)
p = Proxy
matchesTextShowSpec p
genericTextShowSpec p
genericTextShow1Spec p
describe "(Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))
describe "(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)" $ do
matchesTextShowSpec (Proxy :: Proxy (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))
#if MIN_VERSION_ghc_prim(0,7,0)
describe "Solo Int" $ do
let p :: Proxy (Solo Int)
p = Proxy
matchesTextShowSpec p
matchesTextShow1Spec p
#endif
|