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
e258f27e
Commit
e258f27e
authored
May 02, 2014
by
Julien Lopez
Browse files
[TESTS][LAMBDA] Add test List.rev; minor fix on GRAMMAR
parent
b21b40a7
Changes
2
Show whitespace changes
Inline
Side-by-side
tests/lambda/GRAMMAR
View file @
e258f27e
...
...
@@ -26,6 +26,7 @@ expr = id
sigmalist = (* empty *)
| "{" "}" "," sigmalist
| "{" UIDENT "/" type_id sigma "}" "," sigmalist
;;
sigma = (* empty *)
| ";" UIDENT "/" type_id
...
...
tests/lambda/src/main.ml
View file @
e258f27e
...
...
@@ -361,6 +361,13 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
| (el : 'A[{A/(Int|Bool)}]) :: [] -> el
| (el : 'A[{A/(Int|Bool)}]) :: (rest : ['A[{A/(Int|Bool)}]]) ->
(if n = 0 then el else nth.rest.(n-1))).[1; 2; 5; `true; 2].2"
);
assert_equal
~
msg
:
"Test CDuce.runtime.list.rev failed"
~
printer
:
(
fun
x
->
x
)
"(2, (Atom(true), (5, (2, (1, Atom(nil), {}), {}), {}), {}), {})"
(
run_test_eval
"(fun rev l : ['A[{A/(Int|Bool)}]] : ['A[{A/(Int|Bool)}]] ->
match l : ['A[{A/(Int|Bool)}]] with
| (el : 'A[{A/(Int|Bool)}]) :: [] -> [el]
| (el : 'A[{A/(Int|Bool)}]) :: (rest : ['A[{A/(Int|Bool)}]]) ->
(rev.rest) @ [el]).[1; 2; 5; `true; 2]"
);
);
"union"
>::
(
fun
test_ctxt
->
...
...
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