diff options
| author | shejialuo <shejialuo@gmail.com> | 2025-06-29 12:28:23 +0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-07 08:07:46 -0700 |
| commit | 62c514a9efd2206e081509ca3abc9cd5645eff0b (patch) | |
| tree | f1c344625807ccfe816148941d06f8566b4079ac /t/helper/test-string-list.c | |
| parent | 07d90fda58c79af661016137cbbafab169eeb329 (diff) | |
u-string-list: move "test_split_in_place" to "u-string-list.c"
We use "test-tool string-list split_in_place" to test the
"string_list_split_in_place" function. As we have introduced the unit
test, we'd better remove the logic from shell script to C program to
improve test speed and readability.
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-string-list.c')
| -rw-r--r-- | t/helper/test-string-list.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c index 17c18c30f6..8a344347ad 100644 --- a/t/helper/test-string-list.c +++ b/t/helper/test-string-list.c @@ -18,13 +18,6 @@ static void parse_string_list(struct string_list *list, const char *arg) (void)string_list_split(list, arg, ':', -1); } -static void write_list(const struct string_list *list) -{ - int i; - for (i = 0; i < list->nr; i++) - printf("[%d]: \"%s\"\n", i, list->items[i].string); -} - static void write_list_compact(const struct string_list *list) { int i; @@ -46,21 +39,6 @@ static int prefix_cb(struct string_list_item *item, void *cb_data) int cmd__string_list(int argc, const char **argv) { - if (argc == 5 && !strcmp(argv[1], "split_in_place")) { - struct string_list list = STRING_LIST_INIT_NODUP; - int i; - char *s = xstrdup(argv[2]); - const char *delim = argv[3]; - int maxsplit = atoi(argv[4]); - - i = string_list_split_in_place(&list, s, delim, maxsplit); - printf("%d\n", i); - write_list(&list); - string_list_clear(&list, 0); - free(s); - return 0; - } - if (argc == 4 && !strcmp(argv[1], "filter")) { /* * Retain only the items that have the specified prefix. |
