summaryrefslogtreecommitdiff
path: root/testsuite/tests/formats-transition/deprecated_unsigned_printers.ml
blob: 76af1fbdf6b5da052483f34f407c8b4d28ad0adc (plain)
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
(* TEST
 toplevel;
*)

(* %n, %l, %N and %L have a scanf-specific semantics, but are supposed
   to be interpreted by Printf and Format as %u, despite this
   interpretation being mildly deprecated *)

let test format = (Printf.sprintf format (-3) : string)
;;

let () = Printf.printf "%%n: %B\n"
  (test "%n" = test "%u")
;;

let () = Printf.printf "%%l: %B\n"
  (test "%l" = test "%u")
;;

let () = Printf.printf "%%N: %B\n"
  (test "%N" = test "%u")
;;

let () = Printf.printf "%%L: %B\n"
  (test "%L" = test "%u")
;;