1 module UnitTests
.Distribution
.PackageDescription
.Check
(tests
) where
3 import Distribution
.Compat
.Prelude
.Internal
6 import Distribution
.PackageDescription
.Check
9 import Test
.Tasty
.HUnit
12 import Test
.QuickCheck
.Instances
.Cabal
()
17 [ testCase
"Unique ignore strings" (uniqueNames
@?
= True)
18 , testCase
"Short ignore identifiers" (longerThan
@?
= [])
19 , testCase
"Parsimonious '-' use" (usingTooManyDashes
@?
= [])
22 allExplanationIdStrings
:: [CheckExplanationIDString
]
23 allExplanationIdStrings
= map ppCheckExplanationId
[minBound..maxBound]
26 uniqueNames
= length allExplanationIdStrings
== length (nub allExplanationIdStrings
)
28 longerThan
:: [CheckExplanationIDString
]
29 longerThan
= filter ((>25). length) allExplanationIdStrings
31 usingTooManyDashes
:: [CheckExplanationIDString
]
32 usingTooManyDashes
= filter ((>2) . length . filter (=='-'))
33 allExplanationIdStrings