From a54b386dc77bf043ca48e85633b10d81de513019 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sat, 26 Aug 2023 09:24:02 +0100 Subject: [PATCH] test: --ignore-promoted-rules and internal rules reproduce #8417 Signed-off-by: Rudi Grinberg --- .../ignore-promoted-rules-internal-rules.t | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/blackbox-tests/test-cases/ignore-promoted-rules-internal-rules.t diff --git a/test/blackbox-tests/test-cases/ignore-promoted-rules-internal-rules.t b/test/blackbox-tests/test-cases/ignore-promoted-rules-internal-rules.t new file mode 100644 index 000000000000..6e515c5b8ea3 --- /dev/null +++ b/test/blackbox-tests/test-cases/ignore-promoted-rules-internal-rules.t @@ -0,0 +1,32 @@ +This test demonstrates the interaction between --ignore-promoted-rules and +internal promote rules (like generating opam files) + +Reported in #8417 + + $ cat >dune-project < (lang 3.10) + > (generate_opam_files true) + > (package + > (name foo)) + > EOF + + $ dune build foo.opam + File "dune-project", line 1, characters 0-11: + 1 | (lang 3.10) + ^^^^^^^^^^^ + Error: Invalid first line, expected: (lang ) + [1] + $ echo "extra" >> foo.opam + $ cat foo.opam + extra + +This should not modify the file now + + $ dune build --ignore-promoted-rules foo.opam + File "dune-project", line 1, characters 0-11: + 1 | (lang 3.10) + ^^^^^^^^^^^ + Error: Invalid first line, expected: (lang ) + [1] + $ cat foo.opam + extra