diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-07 04:12:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-07 09:05:08 +0300 |
commit | 53b67a801bbce7600f25823c39c7e9e7de8b72b3 (patch) | |
tree | 69ab615ea3100abc20c1baa193c0152eaa30b349 /t/t9303-fast-import-compression.sh | |
parent | 898f80736c75878acc02dc55672317fcc0e0a5a6 (diff) |
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/t9303-fast-import-compression.sh')
-rwxr-xr-x | t/t9303-fast-import-compression.sh | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/t/t9303-fast-import-compression.sh b/t/t9303-fast-import-compression.sh index 5045f02a53..57d916524e 100755 --- a/t/t9303-fast-import-compression.sh +++ b/t/t9303-fast-import-compression.sh @@ -3,12 +3,6 @@ test_description='compression setting of fast-import utility' . ./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" -} - import_large () { ( echo blob @@ -24,7 +18,7 @@ do test_when_finished "rm -f .git/objects/pack/pack-*.*" && test_when_finished "rm -rf .git/objects/??" && import_large -c fastimport.unpacklimit=0 $config && - sz=$(file_size .git/objects/pack/pack-*.pack) && + sz=$(test_file_size .git/objects/pack/pack-*.pack) && case "$expect" in small) test "$sz" -le 100000 ;; large) test "$sz" -ge 100000 ;; @@ -47,7 +41,7 @@ do test_when_finished "rm -f .git/objects/pack/pack-*.*" && test_when_finished "rm -rf .git/objects/??" && import_large -c fastimport.unpacklimit=9 $config && - sz=$(file_size .git/objects/??/????*) && + sz=$(test_file_size .git/objects/??/????*) && case "$expect" in small) test "$sz" -le 100000 ;; large) test "$sz" -ge 100000 ;; |