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
b49243b2
Commit
b49243b2
authored
Apr 29, 2014
by
Kim Nguyễn
Browse files
Remove buggy test case.
parent
284a11ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/libtest/typesTest.ml
View file @
b49243b2
...
...
@@ -4,7 +4,7 @@ open OUnit
let
parse_typ
s
=
let
st
=
Stream
.
of_string
s
in
let
astpat
=
Parser
.
pat
st
in
let
astpat
=
Parser
.
pat
st
in
let
nodepat
=
Typer
.
typ
Builtin
.
env
astpat
in
Types
.
descr
nodepat
;;
...
...
@@ -19,7 +19,7 @@ let variance_test = [
]
let test_variance =
"test variance annotations" >:::
"test variance annotations" >:::
List.map (fun (t1,expected) ->
(Printf.sprintf " %s" t1) >:: (fun _ ->
let t = parse_typ t1 in
...
...
@@ -38,7 +38,7 @@ let set_op_tests = [
]
let
test_set_operations
=
"test set operations"
>:::
"test set operations"
>:::
List
.
map
(
fun
(
s1
,
s2
)
->
(
Printf
.
sprintf
" %s <: %s "
s1
s2
)
>::
(
fun
_
->
let
t1
=
parse_typ
s1
in
...
...
@@ -60,7 +60,7 @@ let subst_tests = [
];;
let
test_substitution
=
"test type substitution operations"
>:::
"test type substitution operations"
>:::
List
.
map
(
fun
(
t
,
v
,
s
,
expected
)
->
(
Printf
.
sprintf
"[%s]{%s/%s}"
)
t
v
s
>::
(
fun
_
->
let
t
=
parse_typ
t
in
...
...
@@ -78,8 +78,6 @@ let test_substitution =
let
rec_subst_tests
=
[
"`$A"
,
"A"
,
"Empty"
;
"`$A"
,
"B"
,
"`$A"
;
"`$A | Int"
,
"A"
,
"X where X = (X | Int)"
;
"`$A | `$B | Int"
,
"A"
,
"X where X = (X | `$B | Int )"
;
"`$A -> `$B"
,
"A"
,
"X where X = X -> `$B"
;
"Bool -> `$B"
,
"A"
,
"Bool -> `$B"
;
"(`$A , `$B)"
,
"A"
,
"X where X = (X, `$B)"
;
...
...
@@ -87,7 +85,7 @@ let rec_subst_tests = [
];;
let
test_rec_subtitutions
=
"test recursive type substitution operations"
>:::
"test recursive type substitution operations"
>:::
List
.
map
(
fun
(
t
,
v
,
expected
)
->
(
Printf
.
sprintf
"mu X . [%s]{%s/X}"
)
t
v
>::
(
fun
_
->
let
t
=
parse_typ
t
in
...
...
@@ -176,7 +174,7 @@ let subtype_tests = [
];;
let
test_subtype
=
"test subtype"
>:::
"test subtype"
>:::
List
.
map
(
fun
(
s1
,
s2
,
expected
)
->
(
Printf
.
sprintf
" %s <: %s "
s1
s2
)
>::
(
fun
_
->
let
t1
=
parse_typ
s1
in
...
...
@@ -198,7 +196,7 @@ let witness_tests = [
"(`A , `$X)"
,
"((`A , (Any
\\
`A)) | (`$X , `A))"
,
false
;
(* (a , a^[ X ]) *)
"(`$X & (`$X , `A))"
,
"`C"
,
false
;
(* (any^[ X ] , A)^[ X ] *)
(* (any^[ X ] , A)^[ X ] *)
"(`$A & (`$A , `T))"
,
"(`T1 -> `T2)"
,
false
;
(* (any^[ A ] , t)^[ A ] *)
...
...
@@ -207,7 +205,7 @@ let witness_tests = [
];;
let
test_witness
=
"test subtype"
>:::
"test subtype"
>:::
List
.
map
(
fun
(
s1
,
s2
,
expected
)
->
(
Printf
.
sprintf
" %s <: %s "
s1
s2
)
>::
(
fun
_
->
let
t1
=
parse_typ
s1
in
...
...
@@ -237,10 +235,9 @@ let all =
test_rec_subtitutions
;
(* test_witness; *)
]
let
main
()
=
OUnit
.
run_test_tt_main
all
;;
main
()
main
()
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