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/t0063-string-list.sh | |
| parent | 07d90fda58c79af661016137cbbafab169eeb329 (diff) | |
| download | git-62c514a9efd2206e081509ca3abc9cd5645eff0b.tar.gz | |
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/t0063-string-list.sh')
| -rwxr-xr-x | t/t0063-string-list.sh | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/t/t0063-string-list.sh b/t/t0063-string-list.sh index 6b20ffd206..1a9cf8bfcf 100755 --- a/t/t0063-string-list.sh +++ b/t/t0063-string-list.sh @@ -7,57 +7,6 @@ test_description='Test string list functionality' . ./test-lib.sh -test_split_in_place() { - cat >expected && - test_expect_success "split (in place) $1 at $2, max $3" " - test-tool string-list split_in_place '$1' '$2' '$3' >actual && - test_cmp expected actual - " -} - -test_split_in_place "foo:;:bar:;:baz:;:" ":;" "-1" <<EOF -10 -[0]: "foo" -[1]: "" -[2]: "" -[3]: "bar" -[4]: "" -[5]: "" -[6]: "baz" -[7]: "" -[8]: "" -[9]: "" -EOF - -test_split_in_place "foo:;:bar:;:baz" ":;" "0" <<EOF -1 -[0]: "foo:;:bar:;:baz" -EOF - -test_split_in_place "foo:;:bar:;:baz" ":;" "1" <<EOF -2 -[0]: "foo" -[1]: ";:bar:;:baz" -EOF - -test_split_in_place "foo:;:bar:;:baz" ":;" "2" <<EOF -3 -[0]: "foo" -[1]: "" -[2]: ":bar:;:baz" -EOF - -test_split_in_place "foo:;:bar:;:" ":;" "-1" <<EOF -7 -[0]: "foo" -[1]: "" -[2]: "" -[3]: "bar" -[4]: "" -[5]: "" -[6]: "" -EOF - test_expect_success "test filter_string_list" ' test "x-" = "x$(test-tool string-list filter - y)" && test "x-" = "x$(test-tool string-list filter no y)" && |
