From 81df8d014516f615486f7962fcfbe93e71d82d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Tue, 16 Feb 2021 21:18:37 +0100 Subject: [PATCH] Add test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Ojeda Bär --- .../test-cases/merlin/merlin-stdlib.t/dune | 1 + .../merlin/merlin-stdlib.t/dune-project | 1 + .../test-cases/merlin/merlin-stdlib.t/run.t | 130 ++++++++++++++++++ .../test-cases/merlin/merlin-stdlib.t/x.ml | 0 4 files changed, 132 insertions(+) create mode 100644 test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune create mode 100644 test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune-project create mode 100644 test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/run.t create mode 100644 test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/x.ml diff --git a/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune new file mode 100644 index 000000000000..4bedbbac1e2a --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune @@ -0,0 +1 @@ +(executable (name x)) diff --git a/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune-project b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune-project new file mode 100644 index 000000000000..c2e46604eedb --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/dune-project @@ -0,0 +1 @@ +(lang dune 2.8) diff --git a/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/run.t b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/run.t new file mode 100644 index 000000000000..c5202dfe5e3a --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/run.t @@ -0,0 +1,130 @@ + $ dune build @check + +Check that STDLIB directive is correctly parsed by merlin + $ ocamlmerlin single dump-configuration -filename x.ml < x.ml | + > jq . + { + "class": "return", + "value": { + "ocaml": { + "include_dirs": [], + "no_std_include": false, + "unsafe": false, + "classic": false, + "principal": false, + "real_paths": true, + "recursive_types": false, + "strict_sequence": false, + "applicative_functors": true, + "unsafe_string": false, + "nopervasives": false, + "strict_formats": false, + "open_modules": [], + "ppx": [], + "pp": null, + "warnings": { + "actives": [ + 1, + 2, + 3, + 5, + 8, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 28, + 31, + 43, + 46, + 47, + 49, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 61, + 62, + 63, + 64, + 65 + ], + "warn_error": [ + 31 + ] + } + }, + "merlin": { + "build_path": [], + "source_path": [], + "cmi_path": [], + "cmt_path": [], + "flags_applied": [], + "extensions": [], + "suffixes": [ + { + "impl": ".ml", + "intf": ".mli" + }, + { + "impl": ".re", + "intf": ".rei" + } + ], + "stdlib": null, + "reader": [], + "protocol": "json", + "log_file": null, + "log_sections": [], + "flags_to_apply": [], + "failures": [ + "No config found for file \"x.ml\". Try calling `dune build`." + ], + "assoc_suffixes": [ + { + "extension": ".re", + "reader": "reason" + }, + { + "extension": ".rei", + "reader": "reason" + } + ] + }, + "query": { + "filename": "x.ml", + "directory": "$TESTCASE_ROOT", + "printer_width": 0, + "verbosity": 0 + } + }, + "notifications": [], + "timing": { + "clock": 5, + "cpu": 1, + "query": 1, + "pp": 0, + "reader": 1, + "ppx": 0, + "typer": 0, + "error": 0 + } + } diff --git a/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/x.ml b/test/blackbox-tests/test-cases/merlin/merlin-stdlib.t/x.ml new file mode 100644 index 000000000000..e69de29bb2d1