summaryrefslogtreecommitdiff
path: root/testsuite/tests/formats-transition/legacy_incompatible_flags.ml
blob: b9978026cec80af65714ae2f18ce18318d65b4f8 (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
(* TEST
 flags = "-no-strict-formats";
 toplevel;
*)

(* the legacy parser ignores flags on formatters on which they make no
   sense *)

let () = Printf.printf "%+s\n" "toto"
;;
let () = Printf.printf "%#s\n" "toto"
;;
let () = Printf.printf "% s\n" "toto"
;;
let () = Printf.printf "%03s\n" "toto"
;;
let () = Printf.printf "%03S\n" "toto"
;;
let () = Printf.printf "%.3s\n" "toto"
;;

(* it still fails on flags used with ignored formats (%_d, etc.),
   but it's unclear how to test that in a backward-compatible way,
   if we accept that the error message may have changed
*)