Skip to content

Commit e4d671c

Browse files
phillipwoodgitster
authored andcommitted
t3701: indent here documents
Indent here documents in line with the current style for tests. While at it, quote the end marker of here-docs that do not use variable interpolation. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 492e60c commit e4d671c

File tree

1 file changed

+87
-87
lines changed

1 file changed

+87
-87
lines changed

t/t3701-add-interactive.sh

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ test_expect_success 'status works (initial)' '
2222
'
2323

2424
test_expect_success 'setup expected' '
25-
cat >expected <<EOF
26-
new file mode 100644
27-
index 0000000..d95f3ad
28-
--- /dev/null
29-
+++ b/file
30-
@@ -0,0 +1 @@
31-
+content
32-
EOF
25+
cat >expected <<-\EOF
26+
new file mode 100644
27+
index 0000000..d95f3ad
28+
--- /dev/null
29+
+++ b/file
30+
@@ -0,0 +1 @@
31+
+content
32+
EOF
3333
'
3434

3535
test_expect_success 'diff works (initial)' '
@@ -59,14 +59,14 @@ test_expect_success 'status works (commit)' '
5959
'
6060

6161
test_expect_success 'setup expected' '
62-
cat >expected <<EOF
63-
index 180b47c..b6f2c08 100644
64-
--- a/file
65-
+++ b/file
66-
@@ -1 +1,2 @@
67-
baseline
68-
+content
69-
EOF
62+
cat >expected <<-\EOF
63+
index 180b47c..b6f2c08 100644
64+
--- a/file
65+
+++ b/file
66+
@@ -1 +1,2 @@
67+
baseline
68+
+content
69+
EOF
7070
'
7171

7272
test_expect_success 'diff works (commit)' '
@@ -83,8 +83,8 @@ test_expect_success 'revert works (commit)' '
8383

8484

8585
test_expect_success 'setup expected' '
86-
cat >expected <<EOF
87-
EOF
86+
cat >expected <<-\EOF
87+
EOF
8888
'
8989

9090
test_expect_success 'setup fake editor' '
@@ -100,21 +100,21 @@ test_expect_success 'dummy edit works' '
100100
'
101101

102102
test_expect_success 'setup patch' '
103-
cat >patch <<EOF
104-
@@ -1,1 +1,4 @@
105-
this
106-
+patch
107-
-does not
108-
apply
109-
EOF
103+
cat >patch <<-\EOF
104+
@@ -1,1 +1,4 @@
105+
this
106+
+patch
107+
-does not
108+
apply
109+
EOF
110110
'
111111

112112
test_expect_success 'setup fake editor' '
113113
echo "#!$SHELL_PATH" >fake_editor.sh &&
114-
cat >>fake_editor.sh <<\EOF &&
115-
mv -f "$1" oldpatch &&
116-
mv -f patch "$1"
117-
EOF
114+
cat >>fake_editor.sh <<-\EOF &&
115+
mv -f "$1" oldpatch &&
116+
mv -f patch "$1"
117+
EOF
118118
chmod a+x fake_editor.sh &&
119119
test_set_editor "$(pwd)/fake_editor.sh"
120120
'
@@ -126,10 +126,10 @@ test_expect_success 'bad edit rejected' '
126126
'
127127

128128
test_expect_success 'setup patch' '
129-
cat >patch <<EOF
130-
this patch
131-
is garbage
132-
EOF
129+
cat >patch <<-\EOF
130+
this patch
131+
is garbage
132+
EOF
133133
'
134134

135135
test_expect_success 'garbage edit rejected' '
@@ -139,28 +139,28 @@ test_expect_success 'garbage edit rejected' '
139139
'
140140

141141
test_expect_success 'setup patch' '
142-
cat >patch <<EOF
143-
@@ -1,0 +1,0 @@
144-
baseline
145-
+content
146-
+newcontent
147-
+lines
148-
EOF
142+
cat >patch <<-\EOF
143+
@@ -1,0 +1,0 @@
144+
baseline
145+
+content
146+
+newcontent
147+
+lines
148+
EOF
149149
'
150150

151151
test_expect_success 'setup expected' '
152-
cat >expected <<EOF
153-
diff --git a/file b/file
154-
index b5dd6c9..f910ae9 100644
155-
--- a/file
156-
+++ b/file
157-
@@ -1,4 +1,4 @@
158-
baseline
159-
content
160-
-newcontent
161-
+more
162-
lines
163-
EOF
152+
cat >expected <<-\EOF
153+
diff --git a/file b/file
154+
index b5dd6c9..f910ae9 100644
155+
--- a/file
156+
+++ b/file
157+
@@ -1,4 +1,4 @@
158+
baseline
159+
content
160+
-newcontent
161+
+more
162+
lines
163+
EOF
164164
'
165165

166166
test_expect_success 'real edit works' '
@@ -222,31 +222,31 @@ test_expect_success 'setup again' '
222222

223223
# Write the patch file with a new line at the top and bottom
224224
test_expect_success 'setup patch' '
225-
cat >patch <<EOF
226-
index 180b47c..b6f2c08 100644
227-
--- a/file
228-
+++ b/file
229-
@@ -1,2 +1,4 @@
230-
+firstline
231-
baseline
232-
content
233-
+lastline
234-
EOF
225+
cat >patch <<-\EOF
226+
index 180b47c..b6f2c08 100644
227+
--- a/file
228+
+++ b/file
229+
@@ -1,2 +1,4 @@
230+
+firstline
231+
baseline
232+
content
233+
+lastline
234+
EOF
235235
'
236236

237237
# Expected output, similar to the patch but w/ diff at the top
238238
test_expect_success 'setup expected' '
239-
cat >expected <<EOF
240-
diff --git a/file b/file
241-
index b6f2c08..61b9053 100755
242-
--- a/file
243-
+++ b/file
244-
@@ -1,2 +1,4 @@
245-
+firstline
246-
baseline
247-
content
248-
+lastline
249-
EOF
239+
cat >expected <<-\EOF
240+
diff --git a/file b/file
241+
index b6f2c08..61b9053 100755
242+
--- a/file
243+
+++ b/file
244+
@@ -1,2 +1,4 @@
245+
+firstline
246+
baseline
247+
content
248+
+lastline
249+
EOF
250250
'
251251

252252
# Test splitting the first patch, then adding both
@@ -259,15 +259,15 @@ test_expect_success 'add first line works' '
259259
'
260260

261261
test_expect_success 'setup expected' '
262-
cat >expected <<EOF
263-
diff --git a/non-empty b/non-empty
264-
deleted file mode 100644
265-
index d95f3ad..0000000
266-
--- a/non-empty
267-
+++ /dev/null
268-
@@ -1 +0,0 @@
269-
-content
270-
EOF
262+
cat >expected <<-\EOF
263+
diff --git a/non-empty b/non-empty
264+
deleted file mode 100644
265+
index d95f3ad..0000000
266+
--- a/non-empty
267+
+++ /dev/null
268+
@@ -1 +0,0 @@
269+
-content
270+
EOF
271271
'
272272

273273
test_expect_success 'deleting a non-empty file' '
@@ -282,11 +282,11 @@ test_expect_success 'deleting a non-empty file' '
282282
'
283283

284284
test_expect_success 'setup expected' '
285-
cat >expected <<EOF
286-
diff --git a/empty b/empty
287-
deleted file mode 100644
288-
index e69de29..0000000
289-
EOF
285+
cat >expected <<-\EOF
286+
diff --git a/empty b/empty
287+
deleted file mode 100644
288+
index e69de29..0000000
289+
EOF
290290
'
291291

292292
test_expect_success 'deleting an empty file' '

0 commit comments

Comments
 (0)