Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
095d7ac0
Commit
095d7ac0
authored
15 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
A simple test for Container.addTwo
parent
7bc82927
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Ganeti/HTools/QC.hs
+12
-1
12 additions, 1 deletion
Ganeti/HTools/QC.hs
test.hs
+3
-0
3 additions, 0 deletions
test.hs
with
15 additions
and
1 deletion
Ganeti/HTools/QC.hs
+
12
−
1
View file @
095d7ac0
...
...
@@ -18,7 +18,7 @@ import qualified Ganeti.HTools.Utils as Utils
-- copied from the introduction to quickcheck
instance
Arbitrary
Char
where
arbitrary
=
choose
(
'
\32
'
,
'
\128
'
)
arbitrary
=
choose
(
'
\32
'
,
'
\128
'
)
-- let's generate a random instance
instance
Arbitrary
Instance
.
Instance
where
...
...
@@ -81,6 +81,17 @@ prop_PeerMap_maxElem pmap =
where
_types
=
pmap
::
PeerMap
.
PeerMap
puniq
=
PeerMap
.
accumArray
const
pmap
-- Container tests
prop_Container_addTwo
cdata
i1
i2
=
fn
i1
i2
cont
==
fn
i2
i1
cont
&&
fn
i1
i2
cont
==
fn
i1
i2
(
fn
i1
i2
cont
)
where
_types
=
(
cdata
::
[
Int
],
i1
::
Int
,
i2
::
Int
)
cont
=
foldl
(
\
c
x
->
Container
.
add
x
x
c
)
Container
.
empty
cdata
fn
x1
x2
=
Container
.
addTwo
x1
x1
x2
x2
-- Simple instance tests, we only have setter/getters
prop_Instance_setIdx
inst
idx
=
...
...
This diff is collapsed.
Click to expand it.
test.hs
+
3
−
0
View file @
095d7ac0
...
...
@@ -21,6 +21,9 @@ main = do
,
run
prop_PeerMap_findMissing
]
runTests
"Container"
options
[
run
prop_Container_addTwo
]
runTests
"Instance"
options
[
run
prop_Instance_setIdx
,
run
prop_Instance_setName
...
...
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