diff --git a/CHANGES.md b/CHANGES.md index 0f9344f1c1..cde92d2fa9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ unreleased + ocaml-index - Improve the granularity of index reading by segmenting the marshalization of the involved data-structures. (#1889) + + test suite + - Add a test case illustrating wrong open order proposed in issue #1900. (#1901) merlin 5.4.1 ============ diff --git a/tests/test-dirs/dune b/tests/test-dirs/dune index 6e9db30beb..44b808f2a8 100755 --- a/tests/test-dirs/dune +++ b/tests/test-dirs/dune @@ -1,6 +1,6 @@ (cram (applies_to no-escape type-expr environment_on_open locate-type - polarity-search) + polarity-search issue1900) (enabled_if (<> %{os_type} Win32))) diff --git a/tests/test-dirs/issue1900.t/a.ml b/tests/test-dirs/issue1900.t/a.ml new file mode 100644 index 0000000000..bf401c9275 --- /dev/null +++ b/tests/test-dirs/issue1900.t/a.ml @@ -0,0 +1 @@ +let x = "test" diff --git a/tests/test-dirs/issue1900.t/dune b/tests/test-dirs/issue1900.t/dune new file mode 100644 index 0000000000..fb4894a793 --- /dev/null +++ b/tests/test-dirs/issue1900.t/dune @@ -0,0 +1,4 @@ +(executable + (name main) + (libraries lib) + (flags :standard -open Lib)) diff --git a/tests/test-dirs/issue1900.t/dune-project b/tests/test-dirs/issue1900.t/dune-project new file mode 100644 index 0000000000..37f995d649 --- /dev/null +++ b/tests/test-dirs/issue1900.t/dune-project @@ -0,0 +1 @@ +(lang dune 3.0) diff --git a/tests/test-dirs/issue1900.t/lib/a.ml b/tests/test-dirs/issue1900.t/lib/a.ml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/test-dirs/issue1900.t/lib/dune b/tests/test-dirs/issue1900.t/lib/dune new file mode 100644 index 0000000000..67263ab7cf --- /dev/null +++ b/tests/test-dirs/issue1900.t/lib/dune @@ -0,0 +1,2 @@ +(library + (name lib)) diff --git a/tests/test-dirs/issue1900.t/main.ml b/tests/test-dirs/issue1900.t/main.ml new file mode 100644 index 0000000000..c6153208da --- /dev/null +++ b/tests/test-dirs/issue1900.t/main.ml @@ -0,0 +1 @@ +prerr_endline A.x diff --git a/tests/test-dirs/issue1900.t/run.t b/tests/test-dirs/issue1900.t/run.t new file mode 100644 index 0000000000..ea0c643f77 --- /dev/null +++ b/tests/test-dirs/issue1900.t/run.t @@ -0,0 +1,78 @@ + $ dune exec ./main.exe + test + +FIXME: There should be no error. + $ $MERLIN single errors -filename main.ml jq '.value.merlin.flags_applied' + [ + { + "workdir": "$TESTCASE_ROOT", + "workval": [ + "-open", + "Dune__exe" + ] + }, + { + "workdir": "$TESTCASE_ROOT", + "workval": [ + "-w", + "@1..3@5..28@30..39@43@46..47@49..57@61..62-40", + "-strict-sequence", + "-strict-formats", + "-short-paths", + "-keep-locs", + "-open", + "Lib", + "-g" + ] + } + ] + +Using a .merlin with the FLG flags in the correct order works: + $ cat >.merlin <<'EOF' + > B _build/default/.main.eobjs/byte + > B _build/default/lib/.lib.objs/byte + > FLG -open Lib + > FLG -open Dune__exe + > EOF + + $ $MERLIN single dump-configuration -filename main.ml jq '.value.merlin.flags_applied' + [ + { + "workdir": "$TESTCASE_ROOT", + "workval": [ + "-open", + "Lib" + ] + }, + { + "workdir": "$TESTCASE_ROOT", + "workval": [ + "-open", + "Dune__exe" + ] + } + ] + + $ $MERLIN single errors -filename main.ml