Skip to content

Commit

Permalink
update new error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg committed Feb 3, 2021
1 parent 3781e0f commit 9fc7faa
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/cmdliner-dep-conf.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
[1]

$ dune build "(fi"
dune: TARGET... arguments: unclosed parenthesis at end of input
dune build: TARGET... arguments: unclosed parenthesis at end of input
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

$ dune build "()"
dune: TARGET... arguments: Unexpected list
dune build: TARGET... arguments: Unexpected list
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/describe.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ Test errors
[1]

$ dune describe --lang 1.0
dune: Only --lang 0.1 is available at the moment as this command is not yet
stabilised. If you would like to release a software that relies on the output
of 'dune describe', please open a ticket on
https://github.com/ocaml/dune.
dune describe: Only --lang 0.1 is available at the moment as this command is not yet
stabilised. If you would like to release a software that relies on the output
of 'dune describe', please open a ticket on
https://github.com/ocaml/dune.
Usage: dune describe [OPTION]... [STRING]...
Try `dune describe --help' or `dune --help' for more information.
[1]
Expand Down
13 changes: 7 additions & 6 deletions test/blackbox-tests/test-cases/dune-init.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@ Comments in dune files are preserved
Will not create components with invalid names

$ dune init lib invalid-component-name ./_test_lib
dune: NAME argument: invalid component name `invalid-component-name'
Library names must be non-empty and composed only of the
following
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
dune init: NAME argument: invalid component name
`invalid-component-name'
Library names must be non-empty and composed only of the
following
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
Usage: dune init [OPTION]... INIT_KIND NAME [PATH]
Try `dune init --help' or `dune --help' for more information.
[1]
Expand All @@ -252,8 +253,8 @@ Will not create components with invalid names
Will fail and inform user when invalid component command is given

$ dune init foo blah
dune: INIT_KIND argument: invalid value `foo', expected one of `executable',
`library', `project' or `test'
dune init: INIT_KIND argument: invalid value `foo', expected one of
`executable', `library', `project' or `test'
Usage: dune init [OPTION]... INIT_KIND NAME [PATH]
Try `dune init --help' or `dune --help' for more information.
[1]
Expand Down
17 changes: 9 additions & 8 deletions test/blackbox-tests/test-cases/github3046.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,29 @@ are given as parameters
`dune init exe main --libs="str gsl"` returns an informative parsing error

$ dune init exe main --libs="str gsl"
dune: option `--libs': invalid element in list (`str gsl'): expected a valid
dune atom
dune init: option `--libs': invalid element in list (`str gsl'): expected a
valid dune atom
Usage: dune init [OPTION]... INIT_KIND NAME [PATH]
Try `dune init --help' or `dune --help' for more information.
[1]

`dune init lib foo --ppx="foo bar"` returns an informative parsing error

$ dune init lib foo --ppx="foo bar"
dune: option `--ppx': invalid element in list (`foo bar'): expected a valid
dune atom
dune init: option `--ppx': invalid element in list (`foo bar'): expected a
valid dune atom
Usage: dune init [OPTION]... INIT_KIND NAME [PATH]
Try `dune init --help' or `dune --help' for more information.
[1]

`dune init lib foo --public="some/invalid&name!"` returns an informative parsing error

$ dune init lib foo --public="some/invalid&name!"
dune: option `--public': invalid component name `some/invalid&name!'
Library names must be non-empty and composed only of the
following
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
dune init: option `--public': invalid component name
`some/invalid&name!'
Library names must be non-empty and composed only of the
following
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
Usage: dune init [OPTION]... INIT_KIND NAME [PATH]
Try `dune init --help' or `dune --help' for more information.
[1]
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/github3530.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ When an empty string is passed to `-p`, we get a nice error message.

$ echo '(lang dune 2.0)' > dune-project
$ dune build -p ''
dune: option `-p': Invalid package name: ""
dune build: option `-p': Invalid package name: ""
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

This can happen in a list as well:

$ dune build -p 'a,b,'
dune: option `-p': Invalid package name: ""
dune build: option `-p': Invalid package name: ""
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]
12 changes: 6 additions & 6 deletions test/blackbox-tests/test-cases/misc.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ Test that incompatible options are properly reported
----------------------------------------------------

$ dune build --verbose --display quiet
dune: Cannot use --verbose and --display simultaneously
dune build: Cannot use --verbose and --display simultaneously
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

$ dune build -p toto --root .
dune: Cannot use --root and -p simultaneously
dune build: Cannot use --root and -p simultaneously
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

$ dune build --for-release-of-packages toto --root .
dune: Cannot use --root and --for-release-of-packages simultaneously
dune build: Cannot use --root and --for-release-of-packages simultaneously
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

$ dune build --no-config --config x
dune: Cannot use --config and --no-config simultaneously
dune build: Cannot use --config and --no-config simultaneously
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

$ dune build -p toto --release
dune: Cannot use --release and -p simultaneously
dune build: Cannot use --release and -p simultaneously
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

$ dune build --release --root .
dune: Cannot use --root and --release simultaneously
dune build: Cannot use --root and --release simultaneously
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]
Expand Down

0 comments on commit 9fc7faa

Please sign in to comment.