diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-07 01:12:57 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-06 22:05:08 -0800 |
commit | 53b67a801bbce7600f25823c39c7e9e7de8b72b3 (patch) | |
tree | 69ab615ea3100abc20c1baa193c0152eaa30b349 /t/t5315-pack-objects-compression.sh | |
parent | 898f80736c75878acc02dc55672317fcc0e0a5a6 (diff) | |
download | git-53b67a801bbce7600f25823c39c7e9e7de8b72b3.tar.gz |
tests: consolidate the `file_size` function into `test-lib-functions.sh`
In 8de7eeb54b6 (compression: unify pack.compression configuration
parsing, 2016-11-15), we introduced identical copies of the `file_size`
helper into three test scripts, with the plan to eventually consolidate
them into a single copy.
Let's do that, and adjust the function name to adhere to the `test_*`
naming convention.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5315-pack-objects-compression.sh')
-rwxr-xr-x | t/t5315-pack-objects-compression.sh | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh index df970d7584..8bacd96275 100755 --- a/t/t5315-pack-objects-compression.sh +++ b/t/t5315-pack-objects-compression.sh @@ -4,12 +4,6 @@ test_description='pack-object compression configuration' . ./test-lib.sh -# This should be moved to test-lib.sh together with the -# copy in t0021 after both topics have graduated to 'master'. -file_size () { - test-tool path-utils file-size "$1" -} - test_expect_success setup ' printf "%2000000s" X | git hash-object -w --stdin >object-name && @@ -24,7 +18,7 @@ do test_expect_success "pack-objects with $config" ' test_when_finished "rm -f pack-*.*" && git $config pack-objects pack <object-name && - sz=$(file_size pack-*.pack) && + sz=$(test_file_size pack-*.pack) && case "$expect" in small) test "$sz" -le 100000 ;; large) test "$sz" -ge 100000 ;; |