Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
8d294687
Commit
8d294687
authored
Jun 01, 2014
by
Julien Lopez
Browse files
[TESTS][LIBTEST] Add tallying tests for records
parent
f5e19b39
Changes
2
Hide whitespace changes
Inline
Side-by-side
runtime/eval.ml
View file @
8d294687
...
...
@@ -100,7 +100,7 @@ and pp_value ppf = function
|
XmlNs
(
_
,_,_,_,
sigma
)
->
Format
.
fprintf
ppf
"XmlNs(%a)"
pp_sigma
sigma
|
Record
(
_
,
sigma
)
->
Format
.
fprintf
ppf
"Record(%a)"
pp_sigma
sigma
|
Atom
(
a
)
->
Format
.
fprintf
ppf
"Atom(%a)"
Atoms
.
V
.
print
a
|
Integer
(
i
)
->
Format
.
fprintf
ppf
"%d"
(
Big_int
.
int_of_big
_int
i
)
|
Integer
(
i
)
->
Format
.
fprintf
ppf
"%d"
(
Intervals
.
V
.
get
_int
i
)
|
Char
(
i
)
->
Format
.
fprintf
ppf
"Char()"
|
Abstraction
(
None
,
_
,
sigma
)
->
Format
.
fprintf
ppf
"Abstraction(None,%a)"
pp_sigma
sigma
...
...
@@ -110,7 +110,7 @@ and pp_value ppf = function
pp_sigma
sigma
|
Abstract
((
name
,
_
))
->
Format
.
fprintf
ppf
"Abstract(%s)"
name
|
String_latin1
(
_
,_,
s
,_
)
->
Format
.
fprintf
ppf
"
\"
%s
\"
"
s
|
String_utf8
(
_
,_,
s
,_
)
->
Format
.
fprintf
ppf
"
\"
%s
\"
"
s
|
String_utf8
(
_
,_,
s
,_
)
->
Format
.
fprintf
ppf
"
\"
%s
\"
"
(
Encodings
.
Utf8
.
get_str
s
)
|
Concat
(
v1
,
v2
)
->
Format
.
fprintf
ppf
"Concat(%a, %a)"
pp_value
v1
...
...
tests/libtest/tallyingTest.ml
View file @
8d294687
...
...
@@ -308,8 +308,14 @@ let tallying_tests = [
[(
"((`$A , Int) & (`$B , Bool))"
,
"(Int , (Int & Bool))"
)]
,
[[]];
(* map even *)
[(
"(`$A -> `$B) -> [`$A ] -> [`$B ]"
,
"((Int -> Bool) & ((`$A
\\
Int) -> (`$A
\\
Int)))"
)]
,
[[]];
[(
"(`$A -> `$A)"
,
"((Int -> Int) & (Bool -> Bool)) -> `$T"
)]
,
mk_e
[]
(* [("(`$A -> `$B) -> [`$A ] -> [`$B ]","((Int -> Bool) & ((`$A \\ Int) -> (`$A \\ Int)))")], [[]];*)
[(
"(`$A -> `$A)"
,
"((Int -> Int) & (Bool -> Bool)) -> `$T"
)]
,
mk_e
[]
;
(* records *)
[(
"{a=Int}"
,
"Any"
)]
,
[[]];
[(
"{a=`$A}"
,
"Any"
)]
,
[[]];
[(
"{a=Int}"
,
"{a=(Int|Bool)}"
)]
,
[[]];
[(
"{a=Int} -> Int"
,
"{a=`$A} -> `$A"
)]
,
[[]];
]
(* to test tallying { sigma_i } -- > for all i => s sigma_i <= t sigma_i *)
...
...
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