master
Valentin Gatien-Baron 2018-07-22 11:26:17 -04:00
parent 36218f05ea
commit 57301e7e40
3 changed files with 34 additions and 8 deletions

View File

@ -52,7 +52,7 @@ Working version
- GPR#1923: Arg module sometimes misbehaved instead of rejecting invalid
-keyword=arg inputs
(Valentin Gatien-Baron, review by ..)
(Valentin Gatien-Baron, review by Gabriel Scherer)
### Other libraries:

View File

@ -38,6 +38,12 @@ let tests = [
Arg.Unit (fun () -> raise @@ Arg.Bad("User-raised error bis")),
"user raised error"]
, ignore, [ "-error" ]
(* bad keyword in various places*)
; [ "-rest", Arg.Rest ignore, "help"], ignore, [ "-rest=1" ]
; [ "-tuple", Arg.Tuple [Arg.Int print_int; Arg.Int print_int ], "help" ]
, ignore, [ "-tuple=1" ]
; [ "-unit", Arg.Unit ignore, "" ], ignore, [ "-unit=1" ]
]
let () =

View File

@ -1,45 +1,65 @@
(1/7) Bad:
(1/10) Bad:
testerror: option '-s' needs an argument.
Arg module testing
-s missing arg
-help Display this list of options
--help Display this list of options
(2/7) Bad:
(2/10) Bad:
testerror: wrong argument 'true'; option '-set=true' expects no argument.
Arg module testing
-set no argument expected
-help Display this list of options
--help Display this list of options
(3/7) Help:
(3/10) Help:
Arg module testing
-help Display this list of options
--help Display this list of options
(4/7) Bad:
(4/10) Bad:
testerror: wrong argument 'not_an_int'; option '-int' expects an integer.
Arg module testing
-int wrong argument type
-help Display this list of options
--help Display this list of options
(5/7) Bad:
(5/10) Bad:
testerror: unknown option '-an-unknown-option'.
Arg module testing
-help Display this list of options
--help Display this list of options
(6/7) Bad:
(6/10) Bad:
testerror: User-raised error.
Arg module testing
-help Display this list of options
--help Display this list of options
(7/7) Bad:
(7/10) Bad:
testerror: User-raised error bis.
Arg module testing
-error user raised error
-help Display this list of options
--help Display this list of options
(8/10) Bad:
testerror: wrong argument '1'; option '-rest=1' expects no argument.
Arg module testing
-rest help
-help Display this list of options
--help Display this list of options
(9/10) Bad:
testerror: wrong argument '1'; option '-tuple=1' expects no argument.
Arg module testing
-tuple help
-help Display this list of options
--help Display this list of options
(10/10) Bad:
testerror: wrong argument '1'; option '-unit=1' expects no argument.
Arg module testing
-help Display this list of options
--help Display this list of options