From: Alexis Laferrière Date: Tue, 1 Sep 2015 18:44:20 +0000 (-0400) Subject: tests/test_opts: report errors X-Git-Tag: v0.7.8~44^2~1 X-Git-Url: http://nitlanguage.org tests/test_opts: report errors Signed-off-by: Alexis Laferrière --- diff --git a/tests/sav/test_opts_args4.res b/tests/sav/test_opts_args4.res index fb2f53c..dddb0a2 100644 --- a/tests/sav/test_opts_args4.res +++ b/tests/sav/test_opts_args4.res @@ -1,6 +1,8 @@ Arguments: 1 -s Rest: 0 +Errors: 1 +Parameter expected for option -s. OptionBool: false OptionCount: 0 OptionString: diff --git a/tests/sav/test_opts_args6.res b/tests/sav/test_opts_args6.res index ee2d2fc..850122f 100644 --- a/tests/sav/test_opts_args6.res +++ b/tests/sav/test_opts_args6.res @@ -1,6 +1,8 @@ Arguments: 1 -a Rest: 0 +Errors: 1 +Parameter expected for option -a. OptionBool: false OptionCount: 0 OptionString: diff --git a/tests/sav/test_opts_args7.res b/tests/sav/test_opts_args7.res index db0466b..720e8ce 100644 --- a/tests/sav/test_opts_args7.res +++ b/tests/sav/test_opts_args7.res @@ -2,6 +2,9 @@ Arguments: 2 -e 1 Rest: 0 +Errors: 1 +Unrecognized value for option -e, --enum. +Expected values are: zero, one, two, tree. OptionBool: false OptionCount: 0 OptionString: diff --git a/tests/test_opts.nit b/tests/test_opts.nit index 05e41b4..b0a2cce 100644 --- a/tests/test_opts.nit +++ b/tests/test_opts.nit @@ -36,6 +36,12 @@ for x in ctx.rest do print x end +var errors = ctx.errors +if errors.not_empty then + print "Errors: {errors.length}" + print ctx.errors.join("\n") +end + print "OptionBool: {ob.value}" print "OptionCount: {oc.value}" if os.value == null then os.value = ""