Skip to content

Commit

Permalink
Tests moved to 'lib-scanf'
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9588 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
xclerc committed Jan 25, 2010
1 parent ad79319 commit e1a9d92
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions testsuite/tests/lib-scanf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MODULES=
MAIN_MODULE=tscanf
ADD_COMPFLAGS=-I $(BASEDIR)/lib
ADD_MODULES=testing

include ../../makefiles/Makefile.one
include ../../makefiles/Makefile.common
11 changes: 6 additions & 5 deletions test/Moretest/tscanf.ml → testsuite/tests/lib-scanf/tscanf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(* *)
(*************************************************************************)

(* $Id$
(* $Id: tscanf.ml 9306 2009-07-03 08:36:54Z weis $
A testbed file for the module Scanf.
Expand Down Expand Up @@ -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) =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions testsuite/tests/lib-scanf/tscanf.reference
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions testsuite/tests/lib-scanf/tscanf_data
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Objective" -> "Caml";

0 comments on commit e1a9d92

Please sign in to comment.