t4014: use indentable here-docs
The convention is to use indentable here-docs within test cases so that the here-docs line up with the rest of the code within the test case. Change here-docs from `<<\EOF` to `<<-\EOF` so that they can be indented along with the rest of the test case. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
92014b69bb
commit
460609cbd5
|
@ -1211,282 +1211,282 @@ append_signoff()
|
||||||
|
|
||||||
test_expect_success 'signoff: commit with no body' '
|
test_expect_success 'signoff: commit with no body' '
|
||||||
append_signoff </dev/null >actual &&
|
append_signoff </dev/null >actual &&
|
||||||
cat <<\EOF | sed "s/EOL$//" >expect &&
|
cat <<-\EOF | sed "s/EOL$//" >expect &&
|
||||||
4:Subject: [PATCH] EOL
|
4:Subject: [PATCH] EOL
|
||||||
8:
|
8:
|
||||||
9:Signed-off-by: C O Mitter <committer@example.com>
|
9:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: commit with only subject' '
|
test_expect_success 'signoff: commit with only subject' '
|
||||||
echo subject | append_signoff >actual &&
|
echo subject | append_signoff >actual &&
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
9:Signed-off-by: C O Mitter <committer@example.com>
|
9:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: commit with only subject that does not end with NL' '
|
test_expect_success 'signoff: commit with only subject that does not end with NL' '
|
||||||
printf subject | append_signoff >actual &&
|
printf subject | append_signoff >actual &&
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
9:Signed-off-by: C O Mitter <committer@example.com>
|
9:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: no existing signoffs' '
|
test_expect_success 'signoff: no existing signoffs' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: no existing signoffs and no trailing NL' '
|
test_expect_success 'signoff: no existing signoffs and no trailing NL' '
|
||||||
printf "subject\n\nbody" | append_signoff >actual &&
|
printf "subject\n\nbody" | append_signoff >actual &&
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: some random signoff' '
|
test_expect_success 'signoff: some random signoff' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
Signed-off-by: my@house
|
Signed-off-by: my@house
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: my@house
|
11:Signed-off-by: my@house
|
||||||
12:Signed-off-by: C O Mitter <committer@example.com>
|
12:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: misc conforming footer elements' '
|
test_expect_success 'signoff: misc conforming footer elements' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
Signed-off-by: my@house
|
Signed-off-by: my@house
|
||||||
(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
|
(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
|
||||||
Tested-by: Some One <someone@example.com>
|
Tested-by: Some One <someone@example.com>
|
||||||
Bug: 1234
|
Bug: 1234
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: my@house
|
11:Signed-off-by: my@house
|
||||||
15:Signed-off-by: C O Mitter <committer@example.com>
|
15:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: some random signoff-alike' '
|
test_expect_success 'signoff: some random signoff-alike' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
Fooled-by-me: my@house
|
Fooled-by-me: my@house
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
11:
|
11:
|
||||||
12:Signed-off-by: C O Mitter <committer@example.com>
|
12:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: not really a signoff' '
|
test_expect_success 'signoff: not really a signoff' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
I want to mention about Signed-off-by: here.
|
I want to mention about Signed-off-by: here.
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
9:I want to mention about Signed-off-by: here.
|
9:I want to mention about Signed-off-by: here.
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: not really a signoff (2)' '
|
test_expect_success 'signoff: not really a signoff (2)' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
My unfortunate
|
My unfortunate
|
||||||
Signed-off-by: example happens to be wrapped here.
|
Signed-off-by: example happens to be wrapped here.
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:Signed-off-by: example happens to be wrapped here.
|
10:Signed-off-by: example happens to be wrapped here.
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: valid S-o-b paragraph in the middle' '
|
test_expect_success 'signoff: valid S-o-b paragraph in the middle' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
Signed-off-by: my@house
|
Signed-off-by: my@house
|
||||||
Signed-off-by: your@house
|
Signed-off-by: your@house
|
||||||
|
|
||||||
A lot of houses.
|
A lot of houses.
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
9:Signed-off-by: my@house
|
9:Signed-off-by: my@house
|
||||||
10:Signed-off-by: your@house
|
10:Signed-off-by: your@house
|
||||||
11:
|
11:
|
||||||
13:
|
13:
|
||||||
14:Signed-off-by: C O Mitter <committer@example.com>
|
14:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: the same signoff at the end' '
|
test_expect_success 'signoff: the same signoff at the end' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
Signed-off-by: C O Mitter <committer@example.com>
|
Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: the same signoff at the end, no trailing NL' '
|
test_expect_success 'signoff: the same signoff at the end, no trailing NL' '
|
||||||
printf "subject\n\nSigned-off-by: C O Mitter <committer@example.com>" |
|
printf "subject\n\nSigned-off-by: C O Mitter <committer@example.com>" |
|
||||||
append_signoff >actual &&
|
append_signoff >actual &&
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
9:Signed-off-by: C O Mitter <committer@example.com>
|
9:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: the same signoff NOT at the end' '
|
test_expect_success 'signoff: the same signoff NOT at the end' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
Signed-off-by: C O Mitter <committer@example.com>
|
Signed-off-by: C O Mitter <committer@example.com>
|
||||||
Signed-off-by: my@house
|
Signed-off-by: my@house
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
12:Signed-off-by: my@house
|
12:Signed-off-by: my@house
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: tolerate garbage in conforming footer' '
|
test_expect_success 'signoff: tolerate garbage in conforming footer' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
Tested-by: my@house
|
Tested-by: my@house
|
||||||
Some Trash
|
Some Trash
|
||||||
Signed-off-by: C O Mitter <committer@example.com>
|
Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
13:Signed-off-by: C O Mitter <committer@example.com>
|
13:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: respect trailer config' '
|
test_expect_success 'signoff: respect trailer config' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
Myfooter: x
|
Myfooter: x
|
||||||
Some Trash
|
Some Trash
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
11:
|
11:
|
||||||
12:Signed-off-by: C O Mitter <committer@example.com>
|
12:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual &&
|
test_cmp expect actual &&
|
||||||
|
|
||||||
test_config trailer.Myfooter.ifexists add &&
|
test_config trailer.Myfooter.ifexists add &&
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
Myfooter: x
|
Myfooter: x
|
||||||
Some Trash
|
Some Trash
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
11:Signed-off-by: C O Mitter <committer@example.com>
|
11:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'signoff: footer begins with non-signoff without @ sign' '
|
test_expect_success 'signoff: footer begins with non-signoff without @ sign' '
|
||||||
append_signoff <<\EOF >actual &&
|
append_signoff <<-\EOF >actual &&
|
||||||
subject
|
subject
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
Reviewed-id: Noone
|
Reviewed-id: Noone
|
||||||
Tested-by: my@house
|
Tested-by: my@house
|
||||||
Change-id: Ideadbeef
|
Change-id: Ideadbeef
|
||||||
Signed-off-by: C O Mitter <committer@example.com>
|
Signed-off-by: C O Mitter <committer@example.com>
|
||||||
Bug: 1234
|
Bug: 1234
|
||||||
EOF
|
EOF
|
||||||
cat >expect <<\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
4:Subject: [PATCH] subject
|
4:Subject: [PATCH] subject
|
||||||
8:
|
8:
|
||||||
10:
|
10:
|
||||||
14:Signed-off-by: C O Mitter <committer@example.com>
|
14:Signed-off-by: C O Mitter <committer@example.com>
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue