X-Git-Url: http://git.efficios.com/?p=argpar.git;a=blobdiff_plain;f=tests%2Ftest_argpar.c;h=f4944eac1e37d1a836e80966ae4118d1e166c45e;hp=458c69e5bd2d9c00cee5ff5d2ae981ff7003b7db;hb=430fe8864aa297e333761b75eaad70900043e3d3;hpb=1c9a6bde7e12e1978e8e47764913a91b7407e9b5;ds=sidebyside diff --git a/tests/test_argpar.c b/tests/test_argpar.c index 458c69e..f4944ea 100644 --- a/tests/test_argpar.c +++ b/tests/test_argpar.c @@ -629,11 +629,23 @@ void fail_tests(void) "While parsing argument #2 (`--`): Invalid argument", descrs); } + + { + const struct argpar_opt_descr descrs[] = { + { 0, 'c', "chevre", false }, + ARGPAR_OPT_DESCR_SENTINEL + }; + + test_fail( + "--chevre=fromage", + "While parsing argument #1 (`--chevre=fromage`): Unexpected argument for option `--chevre`", + descrs); + } } int main(void) { - plan_tests(129); + plan_tests(132); succeed_tests(); fail_tests(); return exit_status();