Commit a328d18b authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Add a new ocaml/cduce test.

parent fdb413cf
......@@ -2,3 +2,18 @@ let print_value (v : Any) : [] =
print_utf8 (string_of v);
print_utf8 "\n"
;;
let split (e : String, l : [String*], acc1 : [String*], acc2 : [String*]) :
([String*], [String*]) =
match l with
[] -> (acc1, acc2)
| (x, ll) -> if x <= e then split (e, ll, (x, acc1), acc2)
else split (e, ll, acc1, (x,acc2))
;;
let sort_string_list (l : [String*]) : [String*] =
match l with
[] -> []
| (elem, rest) -> let (l1, l2) = split (elem, rest,[],[]) in
(sort_string_list l1) @ [elem] @ (sort_string_list l2)
;;
\ No newline at end of file
......@@ -6,8 +6,17 @@
(rule (alias complex_ok) (action (diff complex_ok.exp complex_ok.out)))
; end: complex_ok.cd
; begin: sys_filename_module.cd
(rule (deps sys_filename_module.cd) (target sys_filename_module.cdo)
(action (ignore-outputs (with-accepted-exit-codes 0 (run cduce --compile %{deps})))))
(rule (deps sys_filename_module.cdo) (target sys_filename_module.out)
(action (ignore-stderr (with-stdout-to %{target} (with-accepted-exit-codes 0 (run cduce --run %{deps}))))))
(rule (alias sys_filename_module) (action (diff sys_filename_module.exp sys_filename_module.out)))
; end: sys_filename_module.cd
(alias (name runtest)
(deps
(source_tree ../../common)
(alias complex_ok)
(alias sys_filename_module)
))
include "../../common/utils.cd"
let traverse (dir : Latin1) : [String*] =
let content = Stdlib.Sys.readdir dir in
let dirs = transform content with
[ Char * '.cd' ] & f -> [ f ]
| d -> let path = dir @ "/" @ d in
if Stdlib.Sys.is_directory path then
traverse path
in
dirs
;;
let [] =
let dirs = traverse "../.." in
transform sort_string_list dirs with f -> print_utf8 (f @ "\n")
;;
addrbook.cd
complex_ok.cd
integer_bad_div.cd
integer_bad_mod.cd
integers.cd
lazy.cd
no_ocamliface.cd
no_url_loader.cd
no_xml_plugin.cd
overloading.cd
stack_overflow.cd
sys_filename_module.cd
utils.cd
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment