diff options
Diffstat (limited to 'tests/test_parser.c')
-rw-r--r-- | tests/test_parser.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_parser.c b/tests/test_parser.c index 1309e8e1..6e1d4cde 100644 --- a/tests/test_parser.c +++ b/tests/test_parser.c @@ -667,4 +667,24 @@ parse_options_when_unknown_opt_sets_error(void **state) assert_false(res); options_destroy(options); +} + +void +parse_options_with_duplicated_option_sets_error(void **state) +{ + gchar *args[] = { "cmd1", "cmd2", "opt1", "val1", "opt2", "val2", "opt1", "val3", NULL }; + + GList *keys = NULL; + keys = g_list_append(keys, "opt1"); + keys = g_list_append(keys, "opt2"); + keys = g_list_append(keys, "opt3"); + + gboolean res = TRUE; + + GHashTable *options = parse_options(args, 2, keys, &res); + + assert_null(options); + assert_false(res); + + options_destroy(options); } \ No newline at end of file |