Permalink
Browse files

testsuite for %_[nNlL]

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14824 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
gasche committed May 12, 2014
1 parent ddf133e commit 6a8f12080bd96330718d0e40afba4f6e1d065230
@@ -0,0 +1,30 @@
+(* Benoît's patch did not support %_[nlNL]; test their behavior *)
+
+(* not supported by Printf or Format: fails at runtime *)
+let () = Printf.printf "%_n"
+;;
+let () = Printf.printf "%_N"
+;;
+let () = Printf.printf "%_l"
+;;
+let () = Printf.printf "%_L"
+;;
+
+let () = Format.printf "%_n"
+;;
+let () = Format.printf "%_N"
+;;
+let () = Format.printf "%_l"
+;;
+let () = Format.printf "%_L"
+;;
+
+(* identity for Scanf *)
+let () = print_endline (Scanf.sscanf "" "%_n" "Hello World!")
+;;
+let () = print_endline (Scanf.sscanf "" "%_N" "Hello World!")
+;;
+let () = print_endline (Scanf.sscanf "" "%_l" "Hello World!")
+;;
+let () = print_endline (Scanf.sscanf "" "%_L" "Hello World!")
+;;
@@ -0,0 +1,14 @@
+
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Exception: Invalid_argument "Printf: bad conversion %_".
+# Hello World!
+# Hello World!
+# Hello World!
+# Hello World!
+#

0 comments on commit 6a8f120

Please sign in to comment.