Fix: Error out when passing an argument to long option that takes no argument
[argpar.git] / tests / test_argpar.c
index 458c69e5bd2d9c00cee5ff5d2ae981ff7003b7db..f4944eac1e37d1a836e80966ae4118d1e166c45e 100644 (file)
@@ -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();
This page took 0.030873 seconds and 4 git commands to generate.