summaryrefslogtreecommitdiff
path: root/testsuite/tests/formats-transition/legacy_incompatible_flags.ml
blob: 91b0f6f07fd131aa1704f3f2dfa986d48fbf52d1 (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
*)