Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
bcb4c5f8
Commit
bcb4c5f8
authored
12 years ago
by
Joachim Breitner
Browse files
Options
Downloads
Patches
Plain Diff
Test Distribution.Client.Dependency.Modular.PSQ.splits with QuickCheck
parent
7da27034
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/cabal-install.cabal
+2
-0
2 additions, 0 deletions
cabal-install/cabal-install.cabal
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs
+5
-13
5 additions, 13 deletions
...s/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs
with
7 additions
and
13 deletions
cabal-install/cabal-install.cabal
+
2
−
0
View file @
bcb4c5f8
...
...
@@ -177,7 +177,9 @@ Test-Suite unit-tests
filepath,
test-framework,
test-framework-hunit,
test-framework-quickcheck2,
HUnit,
QuickCheck (>= 2.5),
cabal-install,
Cabal
ghc-options: -Wall
...
...
This diff is collapsed.
Click to expand it.
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs
+
5
−
13
View file @
bcb4c5f8
...
...
@@ -4,12 +4,11 @@ module UnitTests.Distribution.Client.Dependency.Modular.PSQ (
import
Distribution.Client.Dependency.Modular.PSQ
import
Test.Framework
as
TF
(
Test
)
import
Test.Framework.Providers.HUnit
(
testCase
)
import
Test.HUnit
(
Assertion
,
assertEqual
)
import
Test.Framework
as
TF
(
Test
)
import
Test.Framework.Providers.QuickCheck2
tests
::
[
TF
.
Test
]
tests
=
[
test
Case
"splitsAltImplementation"
splitsTest
tests
=
[
test
Property
"splitsAltImplementation"
splitsTest
]
-- | Original splits implementation
...
...
@@ -19,12 +18,5 @@ splits' xs =
(
PSQ
[]
)
(
\
k
v
ys
->
cons
k
(
v
,
ys
)
(
fmap
(
\
(
w
,
zs
)
->
(
w
,
cons
k
v
zs
))
(
splits'
ys
)))
splitsTest
::
Assertion
splitsTest
=
do
assertEqual
""
(
splits'
psq1
)
(
splits
psq1
)
assertEqual
""
(
splits'
psq2
)
(
splits
psq2
)
assertEqual
""
(
splits'
psq3
)
(
splits
psq3
)
where
psq1
=
PSQ
[
(
1
,
2
),
(
3
,
4
),
(
5
,
6
),
(
7
,
8
)
]
::
PSQ
Int
Int
psq2
=
PSQ
[
(
1
,
2
)
]
::
PSQ
Int
Int
psq3
=
PSQ
[]
::
PSQ
Int
Int
splitsTest
::
[(
Int
,
Int
)]
->
Bool
splitsTest
psq
=
splits'
(
PSQ
psq
)
==
splits
(
PSQ
psq
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment