Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-and-itasks
clean-test-properties
Commits
a5137ecd
Commit
a5137ecd
authored
Jun 09, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate preconditions (#16)
parent
44b57b7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
Cloogle
Cloogle
+1
-1
Makefile
Makefile
+2
-1
makecleantest.icl
makecleantest.icl
+8
-4
No files found.
Cloogle
@
393afb03
Compare
23b05936
...
393afb03
Subproject commit
23b05936be80efc2d30df8c09d347bc04754655
d
Subproject commit
393afb033911087478d932ab02236203a77849e
d
Makefile
View file @
a5137ecd
...
...
@@ -5,8 +5,9 @@ CLMFLAGS:=-nr -nt -h 100m -nortsopts\
-IL
Platform
\
-I
Cloogle
\
-I
Cloogle/libcloogle
\
-I
Cloogle/CleanTypes
\
-I
Cloogle/CleanPrettyPrint
\
-I
Cloogle/CleanRegex
\
-I
Cloogle/CleanTypes
\
-I
Cloogle/clean-compiler/frontend
\
-I
Cloogle/clean-compiler/backend
\
-I
Cloogle/clean-compiler/main
\
...
...
makecleantest.icl
View file @
a5137ecd
...
...
@@ -302,7 +302,7 @@ where
generateProperties
::
![
PropertyVarInstantiation
]
![
NamedTestGenerator
]
!
LocationInModule
!
FunctionEntry
->
[
GeneratedProperty
]
generateProperties
pvis
generators
loc
fe
=:{
fe_documentation
=
Just
doc
}
=
[
gen
i
(
fromJust
loc
.
LocationInModule
.
name
)
p
config
[
gen
i
(
fromJust
loc
.
LocationInModule
.
name
)
doc
.
preconditions
p
config
\\
p
<-
doc
.
properties
,
config
<-
configurations
$
groupInstantiations
$
pvis
++
docPropertyTestWith
doc
&
i
<-
[
1
..]]
...
...
@@ -314,8 +314,8 @@ where
configurations
[
vis
:
viss
]
=
[[
vi`
:
vis`
]
\\
vi`
<-
vis
,
vis`
<-
configurations
viss
]
configurations
[]
=
[[]]
gen
::
!
Int
!
String
!
Property
![(
String
,
Type
)]
->
GeneratedProperty
gen
i
fname
(
ForAll
name
ts
imp
)
vis
=
gen
::
!
Int
!
String
![
String
]
!
Property
![(
String
,
Type
)]
->
GeneratedProperty
gen
i
fname
preconditions
(
ForAll
name
ts
imp
)
vis
=
{
gp_name
=
tname
,
gp_implementation
=
join
"
\n
"
[
tname
+++
" :: Property"
...
...
@@ -323,7 +323,11 @@ where
,
"
\t
("
+++
lambda
+++
join
" "
[
name``
+++
"`"
:
map
snd3
ts`
]
+++
")"
,
"where"
,
"
\t
"
+++
name``
+++
"` :: "
+++
toString
type`
,
"
\t
"
+++
join
" "
[
name``
+++
"`"
:
map
fst3
ts`
]
+++
" = prop _p
\n\t
where
\n\t\t
_p = "
+++
replaceSubString
"
\n
"
"
\n\t\t\t
"
imp
,
"
\t
"
+++
join
" "
[
name``
+++
"`"
:
map
fst3
ts`
]
+++
" = prop _p"
,
"
\t
where"
,
"
\t\t
_p = (True"
+++
concat
[
" /
\\
_pre"
<+
i
\\
i
<-
[
1
..]
&
pre
<-
preconditions
]
+++
") ==> _p`"
,
"
\t\t
_p` = "
+++
replaceSubString
"
\n
"
"
\n\t\t\t
"
imp
:
[
"
\t\t
_pre"
<+
i
<+
" = "
+++
s
\\
s
<-
preconditions
&
i
<-
[
1
..]]
]
}
where
...
...
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