Merge branch 'ss/t7401-modernize'

Test clean-up.

* ss/t7401-modernize:
  t7401: add a NEEDSWORK
  t7401: change indentation for enhanced readability
  t7401: change syntax of test_i18ncmp calls for clarity
  t7401: use 'short' instead of 'verify' and cut in rev-parse calls
  t7401: modernize style
This commit is contained in:
Junio C Hamano 2020-09-03 12:37:01 -07:00
commit 3cbff011b0

View File

@ -5,8 +5,11 @@
test_description='Summary support for submodules
This test tries to verify the sanity of summary subcommand of git submodule.
This test script tries to verify the sanity of summary subcommand of git submodule.
'
# NEEDSWORK: This test script is old fashioned and may need a big cleanup due to
# various reasons, one of them being that there are lots of commands taking place
# outside of 'test_expect_success' block, which is no longer in good-style.
. ./test-lib.sh
@ -21,7 +24,7 @@ add_file () {
test_tick &&
git commit -m "Add $name"
done >/dev/null
git rev-parse --verify HEAD | cut -c1-7
git rev-parse --short HEAD
cd "$owd"
}
commit_file () {
@ -125,7 +128,7 @@ commit_file sm1 &&
head3=$(
cd sm1 &&
git reset --hard HEAD~2 >/dev/null &&
git rev-parse --verify HEAD | cut -c1-7
git rev-parse --short HEAD
)
test_expect_success 'modified submodule(backward)' "
@ -181,7 +184,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --cached' "
< Add foo5
EOF
test_i18ncmp actual expected
test_i18ncmp expected actual
"
test_expect_success 'typechanged submodule(submodule->blob), --files' "
@ -191,7 +194,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --files' "
> Add foo5
EOF
test_i18ncmp actual expected
test_i18ncmp expected actual
"
rm -rf sm1 &&
@ -202,7 +205,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' "
* sm1 $head4(submodule)->$head5(blob):
EOF
test_i18ncmp actual expected
test_i18ncmp expected actual
"
rm -f sm1 &&
@ -215,7 +218,7 @@ test_expect_success 'nonexistent commit' "
Warn: sm1 doesn't contain commit $head4_full
EOF
test_i18ncmp actual expected
test_i18ncmp expected actual
"
commit_file
@ -283,7 +286,7 @@ EOF
test_expect_success '--for-status' "
git submodule summary --for-status HEAD^ >actual &&
test_i18ncmp actual - <<EOF
test_i18ncmp - actual <<-EOF
* sm1 $head6...0000000:
* sm2 0000000...$head7 (2):