Adding a test for out of reach scanning indications (should succeed

and return the ``longest match'').


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6680 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Pierre Weis 2004-11-16 10:46:31 +00:00
parent 1676f61cd6
commit 1edb6886cf
1 changed files with 4 additions and 3 deletions

View File

@ -268,7 +268,6 @@ let test11 () =
;;
(* Empty string (end of input) testing. *)
prerr_endline "Testing";;
let test110 () =
sscanf "" " " (fun x -> x) "" = "" &&
sscanf "" "%s" (fun x -> x = "") &&
@ -796,8 +795,10 @@ test (test41 ());;
let test42 () =
let s = "defcbaaghi" in
let ib = Scanning.from_string s in
bscanf ib "%[^abc]%[cba]%s%!" (fun s1 s2 s3 ->
s1 = "def" && s2 = "cbaa" && s3 = "ghi");;
bscanf ib "%[^abc]%[abc]%s%!" (fun s1 s2 s3 ->
s1 = "def" && s2 = "cbaa" && s3 = "ghi") &&
let ib = Scanning.from_string s in
bscanf ib "%s@\t" (fun s -> s = "defcbaaghi");;
test (test42 ());;