mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
The expected SHA-1 digests are always available in variables. Use them instead of hardcoding. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
375775bb12
commit
a742f2a0a7
1 changed files with 26 additions and 22 deletions
|
@ -101,7 +101,11 @@ test_expect_failure 'NUL termination with --stat' '
|
||||||
|
|
||||||
test_expect_success 'setup more commits' '
|
test_expect_success 'setup more commits' '
|
||||||
test_commit "message one" one one message-one &&
|
test_commit "message one" one one message-one &&
|
||||||
test_commit "message two" two two message-two
|
test_commit "message two" two two message-two &&
|
||||||
|
head1=$(git rev-parse --verify --short HEAD~0) &&
|
||||||
|
head2=$(git rev-parse --verify --short HEAD~1) &&
|
||||||
|
head3=$(git rev-parse --verify --short HEAD~2) &&
|
||||||
|
head4=$(git rev-parse --verify --short HEAD~3)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'left alignment formatting' '
|
test_expect_success 'left alignment formatting' '
|
||||||
|
@ -117,18 +121,18 @@ EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'left alignment formatting at the nth column' '
|
test_expect_success 'left alignment formatting at the nth column' "
|
||||||
git log --pretty="format:%h %<|(40)%s" >actual &&
|
git log --pretty='format:%h %<|(40)%s' >actual &&
|
||||||
# complete the incomplete line at the end
|
# complete the incomplete line at the end
|
||||||
echo >>actual &&
|
echo >>actual &&
|
||||||
qz_to_tab_space <<\EOF >expected &&
|
qz_to_tab_space <<\EOF >expected &&
|
||||||
fa33ab1 message two Z
|
$head1 message two Z
|
||||||
7cd6c63 message one Z
|
$head2 message one Z
|
||||||
1711bf9 add bar Z
|
$head3 add bar Z
|
||||||
af20c06 initial Z
|
$head4 initial Z
|
||||||
EOF
|
EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
"
|
||||||
|
|
||||||
test_expect_success 'left alignment formatting with no padding' '
|
test_expect_success 'left alignment formatting with no padding' '
|
||||||
git log --pretty="format:%<(1)%s" >actual &&
|
git log --pretty="format:%<(1)%s" >actual &&
|
||||||
|
@ -195,18 +199,18 @@ EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'right alignment formatting at the nth column' '
|
test_expect_success 'right alignment formatting at the nth column' "
|
||||||
git log --pretty="format:%h %>|(40)%s" >actual &&
|
git log --pretty='format:%h %>|(40)%s' >actual &&
|
||||||
# complete the incomplete line at the end
|
# complete the incomplete line at the end
|
||||||
echo >>actual &&
|
echo >>actual &&
|
||||||
qz_to_tab_space <<\EOF >expected &&
|
qz_to_tab_space <<\EOF >expected &&
|
||||||
fa33ab1 message two
|
$head1 message two
|
||||||
7cd6c63 message one
|
$head2 message one
|
||||||
1711bf9 add bar
|
$head3 add bar
|
||||||
af20c06 initial
|
$head4 initial
|
||||||
EOF
|
EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
"
|
||||||
|
|
||||||
test_expect_success 'right alignment formatting with no padding' '
|
test_expect_success 'right alignment formatting with no padding' '
|
||||||
git log --pretty="format:%>(1)%s" >actual &&
|
git log --pretty="format:%>(1)%s" >actual &&
|
||||||
|
@ -234,18 +238,18 @@ EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'center alignment formatting at the nth column' '
|
test_expect_success 'center alignment formatting at the nth column' "
|
||||||
git log --pretty="format:%h %><|(40)%s" >actual &&
|
git log --pretty='format:%h %><|(40)%s' >actual &&
|
||||||
# complete the incomplete line at the end
|
# complete the incomplete line at the end
|
||||||
echo >>actual &&
|
echo >>actual &&
|
||||||
qz_to_tab_space <<\EOF >expected &&
|
qz_to_tab_space <<\EOF >expected &&
|
||||||
fa33ab1 message two Z
|
$head1 message two Z
|
||||||
7cd6c63 message one Z
|
$head2 message one Z
|
||||||
1711bf9 add bar Z
|
$head3 add bar Z
|
||||||
af20c06 initial Z
|
$head4 initial Z
|
||||||
EOF
|
EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
"
|
||||||
|
|
||||||
test_expect_success 'center alignment formatting with no padding' '
|
test_expect_success 'center alignment formatting with no padding' '
|
||||||
git log --pretty="format:%><(1)%s" >actual &&
|
git log --pretty="format:%><(1)%s" >actual &&
|
||||||
|
|
Loading…
Reference in a new issue