diff options
author | Pierre Weis <Pierre.Weis@inria.fr> | 2010-01-28 17:52:12 +0000 |
---|---|---|
committer | Pierre Weis <Pierre.Weis@inria.fr> | 2010-01-28 17:52:12 +0000 |
commit | 2834a9aff38e9b00441d37c642c2a17114366b89 (patch) | |
tree | 6d5ffbd14d14a976f0cfb5623e85d9fd76b3a158 | |
parent | 23a54e79fc7e55abc9cfea20b7f449c97edbcb56 (diff) | |
download | ocaml-2834a9aff38e9b00441d37c642c2a17114366b89.tar.gz |
Test9 was modified and thus wrong.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9597 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | testsuite/tests/lib-scanf/tscanf.ml | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/testsuite/tests/lib-scanf/tscanf.ml b/testsuite/tests/lib-scanf/tscanf.ml index 110e6b1423..c6fa1f544f 100644 --- a/testsuite/tests/lib-scanf/tscanf.ml +++ b/testsuite/tests/lib-scanf/tscanf.ml @@ -181,12 +181,29 @@ test (test8 ()) (* %S and %s styles. *) let unit fmt s = - let ib = Scanning.from_string (Printf.sprintf "\"%S\"" s) in + let ib = Scanning.from_string (Printf.sprintf "%S" s) in Scanf.bscanf ib fmt id ;; let test_fmt fmt s = unit fmt s = s;; +(* The following test9_string is a result for test9 scanning. + Test9_string is the string "", + that is character i tréma, followed by french right guillemet, + followed by inverted question mark. + It is NOT the string "Ôªø", + that is uppercase o with circonflex accent, followed by commercial a, + followed by empty set. + + In other words, the string "" has the following 3 characters + "\239\187\191". + It has NOT the characters "\212\170\248"! + + Beware with automatic translation by your own local settings + (being your locale or your OS!) +*) +let test9_string = "";; + let test_S = test_fmt "%S";; let test9 () = test_S "poi" && @@ -208,11 +225,11 @@ let test9 () = Scanf.sscanf "\"\\xef\"" "%S" (fun s -> s) = "\xef" && Scanf.sscanf "\"\\xef\\xbb\\xbf\"" "%S" (fun s -> s) = - "Ôªø" && + test9_string && Scanf.sscanf "\"\\xef\\xbb\\xbf\"" "%S" (fun s -> s) = "\239\187\191" && Scanf.sscanf "\"\xef\xbb\xbf\"" "%S" (fun s -> s) = - "Ôªø" && + test9_string && Scanf.sscanf "\"\\\\xef\\\\xbb\\\\xbf\"" "%S" (fun s -> s) = "\\xef\\xbb\\xbf" && Scanf.sscanf "\"\ \"" "%S" (fun s -> s) = |