File: PropertyRTFunctors.hs

package info (click to toggle)
haskell-aeson 2.1.2.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,988 kB
  • sloc: haskell: 11,933; ansic: 123; makefile: 11
file content (52 lines) | stat: -rw-r--r-- 2,975 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
45
46
47
48
49
50
51
52
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeApplications #-}

module PropertyRTFunctors ( roundTripFunctorsTests ) where

import Prelude.Compat

import Data.Functor.Compose (Compose (..))
import Instances ()
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.QuickCheck (testProperty)
import Types
import PropUtils


roundTripFunctorsTests :: TestTree
roundTripFunctorsTests =
  testGroup "functors"
      [ testProperty "Identity Char" $ roundTripEq @(I Int)

      , testProperty "Identity Char" $ roundTripEq @(I Char)
      , testProperty "Identity [Char]" $ roundTripEq @(I String)
      , testProperty "[Identity Char]" $ roundTripEq @([I Char])

      , testProperty "Compose I  I  Int" $ roundTripEq @(LogScaled (Compose I  I  Int))
      , testProperty "Compose [] I  Int" $ roundTripEq @(LogScaled (Compose [] I  Int))
      , testProperty "Compose I  [] Int" $ roundTripEq @(LogScaled (Compose I  [] Int))
      , testProperty "Compose [] [] Int" $ roundTripEq @(LogScaled (Compose [] [] Int))

      , testProperty "Compose I  I  Char" $ roundTripEq @(LogScaled (Compose I  I  Char))
      , testProperty "Compose [] I  Char" $ roundTripEq @(LogScaled (Compose [] I  Char))
      , testProperty "Compose I  [] Char" $ roundTripEq @(LogScaled (Compose I  [] Char))
      , testProperty "Compose [] [] Char" $ roundTripEq @(LogScaled (Compose [] [] Char))

      , testProperty "Compose3 I  I  I  Char" $ roundTripEq @(LogScaled (Compose3 I  I  I  Char))
      , testProperty "Compose3 I  [] I  Char" $ roundTripEq @(LogScaled (Compose3 I  [] I  Char))
      , testProperty "Compose3 I  I  [] Char" $ roundTripEq @(LogScaled (Compose3 I  I  [] Char))
      , testProperty "Compose3 I  [] [] Char" $ roundTripEq @(LogScaled (Compose3 I  [] [] Char))
      , testProperty "Compose3 [] I  I  Char" $ roundTripEq @(LogScaled (Compose3 [] I  I  Char))
      , testProperty "Compose3 [] [] I  Char" $ roundTripEq @(LogScaled (Compose3 [] [] I  Char))
      , testProperty "Compose3 [] I  [] Char" $ roundTripEq @(LogScaled (Compose3 [] I  [] Char))
      , testProperty "Compose3 [] [] [] Char" $ roundTripEq @(LogScaled (Compose3 [] [] [] Char))

      , testProperty "Compose3' I  I  I  Char" $ roundTripEq @(LogScaled (Compose3' I  I  I  Char))
      , testProperty "Compose3' I  [] I  Char" $ roundTripEq @(LogScaled (Compose3' I  [] I  Char))
      , testProperty "Compose3' I  I  [] Char" $ roundTripEq @(LogScaled (Compose3' I  I  [] Char))
      , testProperty "Compose3' I  [] [] Char" $ roundTripEq @(LogScaled (Compose3' I  [] [] Char))
      , testProperty "Compose3' [] I  I  Char" $ roundTripEq @(LogScaled (Compose3' [] I  I  Char))
      , testProperty "Compose3' [] [] I  Char" $ roundTripEq @(LogScaled (Compose3' [] [] I  Char))
      , testProperty "Compose3' [] I  [] Char" $ roundTripEq @(LogScaled (Compose3' [] I  [] Char))
      , testProperty "Compose3' [] [] [] Char" $ roundTripEq @(LogScaled (Compose3' [] [] [] Char))
      ]