Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
nojb committed Dec 3, 2024
1 parent 6978294 commit 73fb0b2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/blackbox-tests/test-cases/formatting/format-dune-file.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,21 @@ Version check.
Error: 'format-dune-file' is only available since version 3.18 of the dune
language. Please update your dune-project file to have (lang dune 3.18).
[1]

Behaviour when the dune file is not syntactically valid.

$ cat >dune-project <<EOF
> (lang dune 3.18)
> EOF

$ cat >dune <<EOF
> (rule (with-stdout-to file (echo "xxx yyy (")))
> (rule (format-dune-file file file.formatted))
> EOF

$ dune build file.formatted
File "_build/default/file", line 1, characters 9-9:
1 | xxx yyy (

Error: unclosed parenthesis at end of input
[1]

0 comments on commit 73fb0b2

Please sign in to comment.