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
3b1b248d
Commit
3b1b248d
authored
Jul 11, 2014
by
Julien Lopez
Browse files
Fix in parser
parent
82c9f052
Changes
2
Hide whitespace changes
Inline
Side-by-side
parser/parser.ml
View file @
3b1b248d
...
@@ -693,8 +693,9 @@ EXTEND Gram
...
@@ -693,8 +693,9 @@ EXTEND Gram
char
:
char
:
[
[
[
c
=
CHAR
->
[
c
=
CHAR
->
Chars
.
V
.
mk_int
(
parse_char
_loc
c
)
Chars
.
V
.
mk_int
(
parse_char
_loc
c
)
]
|
c
=
STRING2
->
Chars
.
V
.
mk_int
(
parse_char
_loc
c
)
]
];
];
...
...
tests/stdlib/list/listtest.cd
View file @
3b1b248d
exit 0;;
include "list.cd"
include "list.cd"
let nb_success = ref Int (0)
let nb_success = ref Int (0)
let nb_tests = ref Int (0)
let nb_tests = ref Int (0)
(* Note: We are using List.iter here *)
(* Note: We are using List.iter here *)
(* TODO: Bugfix: it works here if you replace 'a with 'b *)
let run_test_suite (l : [(Latin1, 'a, 'a)*]) : [] =
let run_test_suite (l : [(Latin1, 'a, 'a)*]) : [] =
iter (fun ((Latin1, 'a, 'a) -> []) (_, x, y) -> nb_tests := !nb_tests + 1;
iter (fun ((Latin1, 'a, 'a) -> []) (_, x, y) -> nb_tests := !nb_tests + 1;
if x = y then nb_success := !nb_success + 1 else []) l
if x = y then nb_success := !nb_success + 1 else []) l
;;
let run_test_suite (l : [(Latin1, 'a, 'a)*]) : [] = match l with
| [] -> []
| [(_, x, y) rest::(Latin1, 'a, 'a)*] -> nb_tests := !nb_tests + 1;
(if x = y then nb_success := !nb_success + 1);
run_test_suite rest
let run_test_suite_debug (l : [(Latin1, 'a, 'a)*]) : [] = match l with
| [] -> []
| [(msg, x, y) rest::(Latin1, 'a, 'a)*] -> nb_tests := !nb_tests + 1;
(if not (x = y) then print msg; print "\nExpected: "; print (string_of y);
print "\nGot:"; print (string_of x); print "\n"
else nb_success := !nb_success + 1); run_test_suite rest
(* Tests *)
(* Tests *)
...
@@ -87,5 +70,3 @@ run_test_suite append_tests;
...
@@ -87,5 +70,3 @@ run_test_suite append_tests;
run_test_suite rev_append_tests;
run_test_suite rev_append_tests;
run_test_suite concat_tests;
run_test_suite concat_tests;
print (string_of !nb_success); print " / "; print (string_of !nb_tests)
print (string_of !nb_success); print " / "; print (string_of !nb_tests)
Tuareg finished at Fri Jul 11 14:24:59
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