1 -- For the deprecated import of Distribution.Compat.Prelude.Internal
2 {-# OPTIONS_GHC -Wwarn=deprecations #-}
4 module UnitTests
.Distribution
.PackageDescription
.Check
(tests
) where
6 import Distribution
.Compat
.Prelude
9 import Distribution
.PackageDescription
.Check
12 import Test
.Tasty
.HUnit
15 import Test
.QuickCheck
.Instances
.Cabal
()
20 [ testCase
"Unique ignore strings" (uniqueNames
@?
= True)
21 , testCase
"Short ignore identifiers" (longerThan
@?
= [])
22 , testCase
"Parsimonious '-' use" (usingTooManyDashes
@?
= [])
25 allExplanationIdStrings
:: [CheckExplanationIDString
]
26 allExplanationIdStrings
= map ppCheckExplanationId
[minBound..maxBound]
29 uniqueNames
= length allExplanationIdStrings
== length (nub allExplanationIdStrings
)
31 longerThan
:: [CheckExplanationIDString
]
32 longerThan
= filter ((>25). length) allExplanationIdStrings
34 usingTooManyDashes
:: [CheckExplanationIDString
]
35 usingTooManyDashes
= filter ((>2) . length . filter (=='-'))
36 allExplanationIdStrings