Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
e412f608
Commit
e412f608
authored
Dec 10, 2008
by
Duncan Coutts
Browse files
Update the VersionInterval properties which now all pass
parent
c2d454a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/Test/Distribution/Version.hs
View file @
e412f608
...
...
@@ -252,12 +252,10 @@ newtype VersionIntervals' = VersionIntervals' [VersionInterval]
instance
Arbitrary
VersionIntervals'
where
arbitrary
=
do
lbound
<-
arbitrary
ubound
<-
arbitrary
bounds
<-
arbitrary
let
intervals
=
mergeTouching
.
map
fixEmpty
.
replaceLower
lbound
.
replaceUpper
ubound
.
pairs
.
sortBy
(
comparing
fst
)
...
...
@@ -269,9 +267,6 @@ instance Arbitrary VersionIntervals' where
:
pairs
bs
pairs
_
=
[]
replaceLower
NoLowerBound
((
_
,
u
)
:
is
)
=
(
NoLowerBound
,
u
)
:
is
replaceLower
_
is
=
is
replaceUpper
NoUpperBound
[(
l
,
_
)]
=
[(
l
,
NoUpperBound
)]
replaceUpper
NoUpperBound
(
i
:
is
)
=
i
:
replaceUpper
NoUpperBound
is
replaceUpper
_
is
=
is
...
...
@@ -284,7 +279,6 @@ instance Arbitrary VersionIntervals' where
doesNotTouch
::
UpperBound
->
LowerBound
->
Bool
doesNotTouch
NoUpperBound
_
=
False
doesNotTouch
_
NoLowerBound
=
False
doesNotTouch
(
UpperBound
u
ub
)
(
LowerBound
l
lb
)
=
u
<
l
||
(
u
==
l
&&
ub
==
ExclusiveBound
&&
lb
==
ExclusiveBound
)
...
...
@@ -300,8 +294,7 @@ instance Arbitrary Bound where
arbitrary
=
elements
[
ExclusiveBound
,
InclusiveBound
]
instance
Arbitrary
LowerBound
where
arbitrary
=
oneof
[
return
NoLowerBound
,
liftM2
LowerBound
arbitrary
arbitrary
]
arbitrary
=
liftM2
LowerBound
arbitrary
arbitrary
instance
Arbitrary
UpperBound
where
arbitrary
=
oneof
[
return
NoUpperBound
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment