tests: consolidate the `file_size` function into `test-lib-functions.sh`
In 8de7eeb54b (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>
maint
Johannes Schindelin4 years agocommitted byJunio C Hamano
@ -432,9 +428,9 @@ test_expect_success PERL 'required process filter should filter data for various
@@ -432,9 +428,9 @@ test_expect_success PERL 'required process filter should filter data for various
@ -573,7 +569,7 @@ test_expect_success PERL 'required process filter should be used only for "clean
@@ -573,7 +569,7 @@ test_expect_success PERL 'required process filter should be used only for "clean
echo "*.r filter=protocol" >.gitattributes &&
cp "$TEST_ROOT/test.o" test.r &&
S=$(file_size test.r) &&
S=$(test_file_size test.r) &&
filter_git add . &&
cat >expected.log <<-EOF &&
@ -697,9 +693,9 @@ test_expect_success PERL 'process filter should restart after unexpected write f
@@ -697,9 +693,9 @@ test_expect_success PERL 'process filter should restart after unexpected write f
echo "this is going to fail" >smudge-write-fail.o &&
cp smudge-write-fail.o smudge-write-fail.r &&
S=$(file_size test.r) &&
S2=$(file_size test2.r) &&
SF=$(file_size smudge-write-fail.r) &&
S=$(test_file_size test.r) &&
S2=$(test_file_size test2.r) &&
SF=$(test_file_size smudge-write-fail.r) &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
MF=$(git hash-object smudge-write-fail.r) &&
@ -752,9 +748,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
@@ -752,9 +748,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
echo "this will cause an error" >error.o &&
cp error.o error.r &&
S=$(file_size test.r) &&
S2=$(file_size test2.r) &&
SE=$(file_size error.r) &&
S=$(test_file_size test.r) &&
S2=$(test_file_size test2.r) &&
SE=$(test_file_size error.r) &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
ME=$(git hash-object error.r) &&
@ -797,7 +793,7 @@ test_expect_success PERL 'process filter abort stops processing of all further f
@@ -797,7 +793,7 @@ test_expect_success PERL 'process filter abort stops processing of all further f
M="blob=$(git hash-object abort.r)" &&
rm -f debug.log &&
SA=$(file_size abort.r) &&
SA=$(test_file_size abort.r) &&
git add . &&
rm -f *.r &&
@ -859,7 +855,7 @@ test_expect_success PERL 'delayed checkout in process filter' '
@@ -859,7 +855,7 @@ test_expect_success PERL 'delayed checkout in process filter' '