Fix Setup.hs `--dependency` example
[cabal.git] / cabal-install / tests / UnitTests / Distribution / Client / BuildReport.hs
blob639e51c100ce1443c2d9d4d59625c056920bb2ac
1 module UnitTests.Distribution.Client.BuildReport
2 ( tests
3 ) where
5 import Distribution.Client.Compat.Prelude
6 import UnitTests.Distribution.Client.ArbitraryInstances ()
7 import UnitTests.Distribution.Client.TreeDiffInstances ()
8 import Prelude ()
10 import Data.TreeDiff.QuickCheck (ediffEq)
11 import Test.QuickCheck (Property, counterexample)
12 import Test.Tasty (TestTree)
13 import Test.Tasty.QuickCheck (testProperty)
15 import Distribution.Client.BuildReports.Anonymous (BuildReport, parseBuildReport, showBuildReport)
16 import Distribution.Simple.Utils (toUTF8BS)
18 -- instances
19 import Test.QuickCheck.Instances.Cabal ()
21 tests :: [TestTree]
22 tests =
23 [ testProperty "test" roundtrip
26 roundtrip :: BuildReport -> Property
27 roundtrip br =
28 counterexample str $
29 Right br `ediffEq` parseBuildReport (toUTF8BS str)
30 where
31 str :: String
32 str = showBuildReport br