diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2014-05-12 15:38:03 +0000 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2014-05-12 15:38:03 +0000 |
commit | 6a8f12080bd96330718d0e40afba4f6e1d065230 (patch) | |
tree | adbb9661cc1ca240fcd9ae7c052b33f7bc40f419 /testsuite | |
parent | ddf133e90fd2e53c696e53b3855d74d3512c3da9 (diff) |
testsuite for %_[nNlL]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14824 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'testsuite')
-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! +# |