t7800: use single quotes for test bodies
In eb84c8b6ce (git-difftool--helper: honor `--trust-exit-code` with `--dir-diff`, 2024-02-20) we have started to loop around some of the tests in t7800 so that they are reexecuted with slightly different arguments. As part of that refactoring the quoting of test bodies was changed from single quotes (') to double quotes (") so that the value of the loop variable is accessible to the body. As the test body is later on passed to eval this change was not required though. Let's revert it back to use single quotes as usual in our tests. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Mar 22, 2024 at 03:23 UTC
c559677c1fc45494ae45adafb35995992740e836
1 file changed
+20
-20
t/t7800-difftool.sh
+20
-20
@@ -93,42 +93,42 @@ test_expect_success 'difftool forwards arguments to diff' '
93
94
for opt in '' '--dir-diff'
95
do
96
- test_expect_success "difftool ${opt:-without options} ignores exit code" "
96
+ test_expect_success "difftool ${opt:-without options} ignores exit code" '
97
test_config difftool.error.cmd false &&
98
git difftool ${opt} -y -t error branch
99
- "
99
+ '
100
101
- test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code" "
101
+ test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code" '
102
test_config difftool.error.cmd false &&
103
test_must_fail git difftool ${opt} -y --trust-exit-code -t error branch
104
- "
104
+ '
105
106
- test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code for built-ins" "
106
+ test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code for built-ins" '
107
test_config difftool.vimdiff.path false &&
108
test_must_fail git difftool ${opt} -y --trust-exit-code -t vimdiff branch
109
- "
109
+ '
110
111
- test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = true" "
111
+ test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = true" '
112
test_config difftool.error.cmd false &&
113
test_config difftool.trustExitCode true &&
114
test_must_fail git difftool ${opt} -y -t error branch
115
- "
115
+ '
116
117
- test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = false" "
117
+ test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = false" '
118
test_config difftool.error.cmd false &&
119
test_config difftool.trustExitCode false &&
120
git difftool ${opt} -y -t error branch
121
- "
121
+ '
122
123
- test_expect_success "difftool ${opt:-without options} ignores exit code with --no-trust-exit-code" "
123
+ test_expect_success "difftool ${opt:-without options} ignores exit code with --no-trust-exit-code" '
124
test_config difftool.error.cmd false &&
125
test_config difftool.trustExitCode true &&
126
git difftool ${opt} -y --no-trust-exit-code -t error branch
127
- "
127
+ '
128
129
- test_expect_success "difftool ${opt:-without options} stops on error with --trust-exit-code" "
130
- test_when_finished 'rm -f for-diff .git/fail-right-file' &&
131
- test_when_finished 'git reset -- for-diff' &&
129
+ test_expect_success "difftool ${opt:-without options} stops on error with --trust-exit-code" '
130
+ test_when_finished "rm -f for-diff .git/fail-right-file" &&
131
+ test_when_finished "git reset -- for-diff" &&
132
write_script .git/fail-right-file <<-\EOF &&
133
echo failed
134
exit 1
@@ -138,19 +138,19 @@ do
138
test_must_fail git difftool ${opt} -y --trust-exit-code \
139
--extcmd .git/fail-right-file branch >actual &&
140
test_line_count = 1 actual
141
- "
141
+ '
142
143
- test_expect_success "difftool ${opt:-without options} honors exit status if command not found" "
143
+ test_expect_success "difftool ${opt:-without options} honors exit status if command not found" '
144
test_config difftool.nonexistent.cmd i-dont-exist &&
145
test_config difftool.trustExitCode false &&
146
- if test "${opt}" = '--dir-diff'
146
+ if test "${opt}" = --dir-diff
147
then
148
expected_code=127
149
else
150
expected_code=128
151
fi &&
152
- test_expect_code \${expected_code} git difftool ${opt} -y -t nonexistent branch
153
- "
152
+ test_expect_code ${expected_code} git difftool ${opt} -y -t nonexistent branch
153
+ '
154
done
155
156
test_expect_success 'difftool honors --gui' '