summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Clerc <xavier.clerc@inria.fr>2010-01-25 14:38:01 +0000
committerXavier Clerc <xavier.clerc@inria.fr>2010-01-25 14:38:01 +0000
commite1a9d92a0c6c1d82704db3b203ad7c45d0cc92ac (patch)
tree839c3b9dafd7f72ec9fc6a7a64d276c333275cc1
parentad793191d9dc6c64ba243d075aae951a34a575fa (diff)
downloadocaml-e1a9d92a0c6c1d82704db3b203ad7c45d0cc92ac.tar.gz
Tests moved to 'lib-scanf'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9588 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testsuite/tests/lib-scanf/Makefile7
-rw-r--r--testsuite/tests/lib-scanf/tscanf.ml (renamed from test/Moretest/tscanf.ml)11
-rw-r--r--testsuite/tests/lib-scanf/tscanf.reference2
-rw-r--r--testsuite/tests/lib-scanf/tscanf_data1
4 files changed, 16 insertions, 5 deletions
diff --git a/testsuite/tests/lib-scanf/Makefile b/testsuite/tests/lib-scanf/Makefile
new file mode 100644
index 0000000000..0be4bf14e6
--- /dev/null
+++ b/testsuite/tests/lib-scanf/Makefile
@@ -0,0 +1,7 @@
+MODULES=
+MAIN_MODULE=tscanf
+ADD_COMPFLAGS=-I $(BASEDIR)/lib
+ADD_MODULES=testing
+
+include ../../makefiles/Makefile.one
+include ../../makefiles/Makefile.common
diff --git a/test/Moretest/tscanf.ml b/testsuite/tests/lib-scanf/tscanf.ml
index 73aa0e2674..110e6b1423 100644
--- a/test/Moretest/tscanf.ml
+++ b/testsuite/tests/lib-scanf/tscanf.ml
@@ -10,7 +10,7 @@
(* *)
(*************************************************************************)
-(* $Id$
+(* $Id: tscanf.ml 9306 2009-07-03 08:36:54Z weis $
A testbed file for the module Scanf.
@@ -208,11 +208,11 @@ let test9 () =
Scanf.sscanf "\"\\xef\"" "%S" (fun s -> s) =
"\xef" &&
Scanf.sscanf "\"\\xef\\xbb\\xbf\"" "%S" (fun s -> s) =
- "" &&
+ "Ôªø" &&
Scanf.sscanf "\"\\xef\\xbb\\xbf\"" "%S" (fun s -> s) =
"\239\187\191" &&
Scanf.sscanf "\"\xef\xbb\xbf\"" "%S" (fun s -> s) =
- "" &&
+ "Ôªø" &&
Scanf.sscanf "\"\\\\xef\\\\xbb\\\\xbf\"" "%S" (fun s -> s) =
"\\xef\\xbb\\xbf" &&
Scanf.sscanf "\"\ \"" "%S" (fun s -> s) =
@@ -357,7 +357,7 @@ let rec scan_elems ib accu =
| ';' -> scan_elems ib (i :: accu)
| ']' -> List.rev (i :: accu)
| '[' when accu = [] -> scan_elems ib (i :: accu)
- | c -> prerr_endline (String.make 1 c); failwith "scan_elems")
+ | c -> print_endline (String.make 1 c); failwith "scan_elems")
with
| Scan_failure _ -> bscanf ib "]" (); accu
| End_of_file -> accu
@@ -899,7 +899,7 @@ let scan_float_list_list =
;;
(* The killer way to define [scan_float_list_list]. *)
-let scan_float_list_list = scan_list scan_float_list;;
+(* let scan_float_list_list = scan_list scan_float_list;; *)
test (
scan_float_list_list
@@ -953,6 +953,7 @@ let make_read_elem fmt f ib = Scanf.bscanf ib fmt f;;
let scan_List fmt = read_list (make_read_elem fmt);;
(* Example for list of floatting point numbers. *)
+(*
scan_List "%f";;
- : Scanf.Scanning.scanbuf -> float list = <fun>
diff --git a/testsuite/tests/lib-scanf/tscanf.reference b/testsuite/tests/lib-scanf/tscanf.reference
new file mode 100644
index 0000000000..edeff6725a
--- /dev/null
+++ b/testsuite/tests/lib-scanf/tscanf.reference
@@ -0,0 +1,2 @@
+0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
+All tests succeeded.
diff --git a/testsuite/tests/lib-scanf/tscanf_data b/testsuite/tests/lib-scanf/tscanf_data
new file mode 100644
index 0000000000..e4ae5b689a
--- /dev/null
+++ b/testsuite/tests/lib-scanf/tscanf_data
@@ -0,0 +1 @@
+"Objective" -> "Caml";