diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-09-12 16:04:45 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-12 11:43:25 -0700 |
commit | 31d5451eed2677531c80177ff9dc8f5285f5a187 (patch) | |
tree | bd709b58ba3096867e2f6166f516773b67aad0e1 /t | |
parent | string_list: add a new function, filter_string_list() (diff) | |
download | tgif-31d5451eed2677531c80177ff9dc8f5285f5a187.tar.xz |
string_list: add a new function, string_list_remove_duplicates()
Add a function that deletes duplicate entries from a sorted
string_list.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t0063-string-list.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t0063-string-list.sh b/t/t0063-string-list.sh index a5f05cd206..dbfc05ebdc 100755 --- a/t/t0063-string-list.sh +++ b/t/t0063-string-list.sh @@ -71,4 +71,21 @@ test_expect_success "test filter_string_list" ' test "x-" = "x$(test-string-list filter x1:x2 y)" ' +test_expect_success "test remove_duplicates" ' + test "x-" = "x$(test-string-list remove_duplicates -)" && + test "x" = "x$(test-string-list remove_duplicates "")" && + test a = "$(test-string-list remove_duplicates a)" && + test a = "$(test-string-list remove_duplicates a:a)" && + test a = "$(test-string-list remove_duplicates a:a:a:a:a)" && + test a:b = "$(test-string-list remove_duplicates a:b)" && + test a:b = "$(test-string-list remove_duplicates a:a:b)" && + test a:b = "$(test-string-list remove_duplicates a:b:b)" && + test a:b:c = "$(test-string-list remove_duplicates a:b:c)" && + test a:b:c = "$(test-string-list remove_duplicates a:a:b:c)" && + test a:b:c = "$(test-string-list remove_duplicates a:b:b:c)" && + test a:b:c = "$(test-string-list remove_duplicates a:b:c:c)" && + test a:b:c = "$(test-string-list remove_duplicates a:a:b:b:c:c)" && + test a:b:c = "$(test-string-list remove_duplicates a:a:a:b:b:b:c:c:c)" +' + test_done |