diff options
-rw-r--r-- | testsuite/tests/formats-transition/ignored_scan_counters.ml | 30 | ||||
-rw-r--r-- | testsuite/tests/formats-transition/ignored_scan_counters.ml.reference | 14 |
2 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/tests/formats-transition/ignored_scan_counters.ml b/testsuite/tests/formats-transition/ignored_scan_counters.ml new file mode 100644 index 000000000..706a1af6f --- /dev/null +++ b/testsuite/tests/formats-transition/ignored_scan_counters.ml @@ -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!") +;; diff --git a/testsuite/tests/formats-transition/ignored_scan_counters.ml.reference b/testsuite/tests/formats-transition/ignored_scan_counters.ml.reference new file mode 100644 index 000000000..6d8d098b5 --- /dev/null +++ b/testsuite/tests/formats-transition/ignored_scan_counters.ml.reference @@ -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! +# |