summaryrefslogtreecommitdiff
path: root/testsuite/tests/formats-transition/legacy_unfinished_modifiers.ml
blob: 9bbaa178a3ed1b6976a341be902d98e6ed57007d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(* TEST
   flags = "-no-strict-formats"
   * toplevel
*)

(* test whether padding modifiers are accepted without any padding
   size

   the precision modifier is accepted without precision setting, but it
   defaults to 0, which is not the same thing as not having precision:
     %.0f 3.5 => 3
     %.f 3.5 => 3
     %f  3.5 => 3.5
*)

let () = Printf.printf "%0d\n" 3
;;
let () = Printf.printf "%-d\n" 3
;;
let () = Printf.printf "%.d\n" 3
;;
let () = Printf.printf "%.f\n" 3.
;;