Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-and-itasks
clean-test-properties
Commits
8b561379
Verified
Commit
8b561379
authored
Nov 05, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't generate duplicate properties for properties that use less type variables
parent
ef4b096b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/testproperties.icl
src/testproperties.icl
+14
-6
No files found.
src/testproperties.icl
View file @
8b561379
...
@@ -362,11 +362,19 @@ generateProperties :: ![PropertyVarInstantiation] ![NamedTestGenerator] !String
...
@@ -362,11 +362,19 @@ generateProperties :: ![PropertyVarInstantiation] ![NamedTestGenerator] !String
generateProperties
pvis
generators
fname
doc
=
generateProperties
pvis
generators
fname
doc
=
[
gen
i
fname
doc
.
preconditions
p
config
[
gen
i
fname
doc
.
preconditions
p
config
\\
p
<-
doc
.
properties
\\
p
<-
doc
.
properties
,
config
<-
configurations
$
groupInstantiations
$
pvis
++
docPropertyTestWith
doc
,
config
<-
configurations
ForProperty
p
(
pvis
++
docPropertyTestWith
doc
)
&
i
<-
[
1
..]]
&
i
<-
[
1
..]]
where
where
groupInstantiations
::
[
PropertyVarInstantiation
]
->
[[(
String
,
Type
)]]
configurationsForProperty
::
!
Property
![
PropertyVarInstantiation
]
->
[[(
String
,
Type
)]]
groupInstantiations
pvis
=
groupBy
((==)
`
on`
fst
)
$
sortBy
((<)
`
on`
fst
)
[
vi
\\
PropertyVarInstantiation
vi
<-
pvis
]
configurationsForProperty
(
ForAll
_
ts
_)
pvis
=
case
[
vi
\\
PropertyVarInstantiation
vi
=:(
v
,_)
<-
pvis
|
isMember
v
allvs
]
of
[]
->
[[]]
vis
->
configurations
$
groupInstantiations
vis
where
allvs
=
concatMap
(
allVars
o
snd
)
ts
groupInstantiations
::
[(
String
,
Type
)]
->
[[(
String
,
Type
)]]
groupInstantiations
pvis
=
groupBy
((==)
`
on`
fst
)
$
sortBy
((<)
`
on`
fst
)
pvis
configurations
::
[[(
String
,
Type
)]]
->
[[(
String
,
Type
)]]
configurations
::
[[(
String
,
Type
)]]
->
[[(
String
,
Type
)]]
configurations
[
vis
:
viss
]
=
[[
vi`
:
vis`
]
\\
vi`
<-
vis
,
vis`
<-
configurations
viss
]
configurations
[
vis
:
viss
]
=
[[
vi`
:
vis`
]
\\
vi`
<-
vis
,
vis`
<-
configurations
viss
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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