summaryrefslogtreecommitdiff
path: root/test-string-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'test-string-list.c')
-rw-r--r--test-string-list.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test-string-list.c b/test-string-list.c
index 702276c1fc..2d6eda707e 100644
--- a/test-string-list.c
+++ b/test-string-list.c
@@ -87,6 +87,16 @@ int main(int argc, char **argv)
return 0;
}
+ if (argc == 3 && !strcmp(argv[1], "remove_duplicates")) {
+ struct string_list list = STRING_LIST_INIT_DUP;
+
+ parse_string_list(&list, argv[2]);
+ string_list_remove_duplicates(&list, 0);
+ write_list_compact(&list);
+ string_list_clear(&list, 0);
+ return 0;
+ }
+
fprintf(stderr, "%s: unknown function name: %s\n", argv[0],
argv[1] ? argv[1] : "(there was none)");
return 1;