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
29929a5d
Commit
29929a5d
authored
Jul 23, 2014
by
Pietro Abate
Browse files
Merge branch 'master' of
https://git.cduce.org/cduce
parents
1cb27884
e629fd0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
ocamliface/mlstub.ml
View file @
29929a5d
...
...
@@ -48,11 +48,7 @@ let consId s =
aux
0
let
ident_to_string
list
=
let
rec
_ident_to_string
list
res
=
match
list
with
|
(
id
,
x
)
::
rest
->
_ident_to_string
rest
(
res
@
[
id
.
Caml_cduce
.
Ident
.
name
,
x
])
|
[]
->
res
in
_ident_to_string
list
[]
;;
List
.
map
(
fun
(
id
,
x
)
->
id
.
Caml_cduce
.
Ident
.
name
,
x
)
list
let
rec
typ
t
=
try
IntHash
.
find
memo_typ
t
.
uid
...
...
tests/lambda/src/lambdaTests.ml
View file @
29929a5d
...
...
@@ -153,7 +153,7 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
"misc"
>::
(
fun
test_ctxt
->
assert_equal
~
msg
:
"Test CDuce.runtime.misc.even failed"
~
printer
:
(
fun
x
->
x
)
"Abstraction([(Int,Bool),(Any
\\
(
Int
)
,Any
\\
(
Int)
)
],Mono)"
"Abstraction([(Int,Bool),(Any
\\
Int,Any
\\
Int)],Mono)"
(
run_test_eval
"fun ((Int -> Bool) & ((!Int) -> (!Int)))
| x : Int -> (match (x % 2) : Int with
| 0 -> `true
...
...
@@ -185,7 +185,7 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
| x : (!Int) -> x).[2; 3]"
);
assert_equal
~
msg
:
"Test CDuce.runtime.misc.is_int failed"
~
printer
:
(
fun
x
->
x
)
"Abstraction([(Int,Bool),(Bool,Bool),(Any
\\
(
(Bool | Int)),Any
\\
((Bool | Int)
))],Mono)"
"Abstraction([(Int,Bool),(Bool,Bool),(Any
\\
(
Int | Bool),Any
\\
(Int | Bool
))],Mono)"
(
run_test_eval
"fun ((Int -> Bool) & (Bool -> Bool) & ((!(Int|Bool)) -> (!(Int|Bool))))
| x : Int -> `true
| x : Bool -> `false
...
...
@@ -285,7 +285,7 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
| x : (!(Int|Bool)) -> x).[`true; 3; `true]"
);
assert_equal
~
msg
:
"Test CDuce.runtime.misc.firsts failed"
~
printer
:
(
fun
x
->
x
)
"Abstraction([((Int,Int),
X1 -> X1 where X1 =
(Int,Int))],Mono)"
"Abstraction([((Int,Int),
(Int,Int) ->
(Int,Int))],Mono)"
(
run_test_eval
"fun firsts x : (Int*Int) y : (Int*Int) : (Int*Int) ->
match x,y : ((Int*Int)*(Int*Int)) with
| (a : Int,_ : Int),(b : Int,_ : Int) -> a,b"
);
...
...
@@ -409,10 +409,10 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
"union"
>::
(
fun
test_ctxt
->
assert_equal
~
msg
:
"Test CDuce.runtime.union.identity failed"
~
printer
:
(
fun
x
->
x
)
"Abstraction([(
(Int |
[ Char* ]
),(Int |
[ Char* ]
)
)],Mono)"
~
printer
:
(
fun
x
->
x
)
"Abstraction([([ Char* ]
| Int,
[ Char* ]
| Int
)],Mono)"
(
run_test_eval
"fun f x : (Int | String) : (Int | String) -> x"
);
assert_equal
~
msg
:
"Test CDuce.runtime.union.match failed"
~
printer
:
(
fun
x
->
x
)
"Abstraction([(
(Int |
[ Char* ]
),(Int |
[ Char* ]
)
)],Mono)"
~
printer
:
(
fun
x
->
x
)
"Abstraction([([ Char* ]
| Int,
[ Char* ]
| Int
)],Mono)"
(
run_test_eval
"fun f x : (Int | String) : (Int | String) ->
match x : (Int | String) with
| _ : Int -> 2
...
...
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