File: BuildReport.hs

package info (click to toggle)
haskell-cabal-install 3.10.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,400 kB
  • sloc: haskell: 52,202; sh: 80; makefile: 9
file content (32 lines) | stat: -rw-r--r-- 916 bytes parent folder | download | duplicates (2)
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
module UnitTests.Distribution.Client.BuildReport (
    tests,
) where

import Distribution.Client.Compat.Prelude
import Prelude ()
import UnitTests.Distribution.Client.ArbitraryInstances ()
import UnitTests.Distribution.Client.TreeDiffInstances ()

import Data.TreeDiff.QuickCheck (ediffEq)
import Test.QuickCheck          (Property, counterexample)
import Test.Tasty               (TestTree)
import Test.Tasty.QuickCheck    (testProperty)

import Distribution.Client.BuildReports.Anonymous (BuildReport, parseBuildReport, showBuildReport)
import Distribution.Simple.Utils                  (toUTF8BS)

-- instances
import Test.QuickCheck.Instances.Cabal ()

tests :: [TestTree]
tests =
    [ testProperty "test" roundtrip
    ]

roundtrip :: BuildReport -> Property
roundtrip br =
    counterexample str $
    Right br `ediffEq` parseBuildReport (toUTF8BS str)
  where
    str :: String
    str = showBuildReport br