From d17292f6cdc0073e5711eebbbba8447ffe1b64d9 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 1 Jun 2018 14:15:25 +0700 Subject: [PATCH] Add quoted case to quoting test When ${@}, the current behavior should be preserved Signed-off-by: Rudi Grinberg --- test/blackbox-tests/test-cases/quoting/bad/dune | 3 +++ test/blackbox-tests/test-cases/quoting/dune | 3 --- test/blackbox-tests/test-cases/quoting/good/dune | 3 +++ test/blackbox-tests/test-cases/quoting/run.t | 10 ++++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 test/blackbox-tests/test-cases/quoting/bad/dune delete mode 100644 test/blackbox-tests/test-cases/quoting/dune create mode 100644 test/blackbox-tests/test-cases/quoting/good/dune diff --git a/test/blackbox-tests/test-cases/quoting/bad/dune b/test/blackbox-tests/test-cases/quoting/bad/dune new file mode 100644 index 00000000..5920e9ae --- /dev/null +++ b/test/blackbox-tests/test-cases/quoting/bad/dune @@ -0,0 +1,3 @@ +(rule + ((targets (x y)) + (action (with-stdout-to ${@} (echo foo))))) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/quoting/dune b/test/blackbox-tests/test-cases/quoting/dune deleted file mode 100644 index 648656a6..00000000 --- a/test/blackbox-tests/test-cases/quoting/dune +++ /dev/null @@ -1,3 +0,0 @@ -(rule - ((targets (x y)) - (action (with-stdout-to ${@} (echo foo))))) diff --git a/test/blackbox-tests/test-cases/quoting/good/dune b/test/blackbox-tests/test-cases/quoting/good/dune new file mode 100644 index 00000000..ba9c28f6 --- /dev/null +++ b/test/blackbox-tests/test-cases/quoting/good/dune @@ -0,0 +1,3 @@ +(rule + ((targets (s t)) + (action (with-stdout-to "${@}" (echo foo))))) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/quoting/run.t b/test/blackbox-tests/test-cases/quoting/run.t index 41161049..5bfd5e4d 100644 --- a/test/blackbox-tests/test-cases/quoting/run.t +++ b/test/blackbox-tests/test-cases/quoting/run.t @@ -1,9 +1,15 @@ This behavior is surprising, we should get an error about the fact that ${@} is not quoted and doesn't contain exactly 1 element - $ dune build x + $ dune build --root bad x 2>&1 | grep -v Entering Error: Rule failed to generate the following targets: - x - y - [1] + +The targets should only be interpreted as a single path when quoted + + $ dune build --root good s 2>&1 | grep -v Entering + Error: Rule failed to generate the following targets: + - s + - t