Skip to content

Commit ac45f68

Browse files
pks-tgitster
authored andcommitted
t7800: improve test descriptions with empty arguments
Some of the tests in t7800 are executed repeatedly in a loop with different arguments. To distinguish these tests, the value of that variable is rendered into the test title. But given that one of the values is the empty string, it results in a somewhat awkward test name: difftool ignores exit code Improve this by printing "without options" in case the value is empty. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb84c8b commit ac45f68

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

t/t7800-difftool.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,40 +93,40 @@ test_expect_success 'difftool forwards arguments to diff' '
9393

9494
for opt in '' '--dir-diff'
9595
do
96-
test_expect_success "difftool ${opt} ignores exit code" "
96+
test_expect_success "difftool ${opt:-without options} ignores exit code" "
9797
test_config difftool.error.cmd false &&
9898
git difftool ${opt} -y -t error branch
9999
"
100100

101-
test_expect_success "difftool ${opt} forwards exit code with --trust-exit-code" "
101+
test_expect_success "difftool ${opt:-without options} forwards exit code with --trust-exit-code" "
102102
test_config difftool.error.cmd false &&
103103
test_must_fail git difftool ${opt} -y --trust-exit-code -t error branch
104104
"
105105

106-
test_expect_success "difftool ${opt} 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" "
107107
test_config difftool.vimdiff.path false &&
108108
test_must_fail git difftool ${opt} -y --trust-exit-code -t vimdiff branch
109109
"
110110

111-
test_expect_success "difftool ${opt} honors difftool.trustExitCode = true" "
111+
test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = true" "
112112
test_config difftool.error.cmd false &&
113113
test_config difftool.trustExitCode true &&
114114
test_must_fail git difftool ${opt} -y -t error branch
115115
"
116116

117-
test_expect_success "difftool ${opt} honors difftool.trustExitCode = false" "
117+
test_expect_success "difftool ${opt:-without options} honors difftool.trustExitCode = false" "
118118
test_config difftool.error.cmd false &&
119119
test_config difftool.trustExitCode false &&
120120
git difftool ${opt} -y -t error branch
121121
"
122122

123-
test_expect_success "difftool ${opt} ignores exit code with --no-trust-exit-code" "
123+
test_expect_success "difftool ${opt:-without options} ignores exit code with --no-trust-exit-code" "
124124
test_config difftool.error.cmd false &&
125125
test_config difftool.trustExitCode true &&
126126
git difftool ${opt} -y --no-trust-exit-code -t error branch
127127
"
128128

129-
test_expect_success "difftool ${opt} stops on error with --trust-exit-code" "
129+
test_expect_success "difftool ${opt:-without options} stops on error with --trust-exit-code" "
130130
test_when_finished 'rm -f for-diff .git/fail-right-file' &&
131131
test_when_finished 'git reset -- for-diff' &&
132132
write_script .git/fail-right-file <<-\EOF &&
@@ -140,7 +140,7 @@ do
140140
test_line_count = 1 actual
141141
"
142142

143-
test_expect_success "difftool ${opt} honors exit status if command not found" "
143+
test_expect_success "difftool ${opt:-without options} honors exit status if command not found" "
144144
test_config difftool.nonexistent.cmd i-dont-exist &&
145145
test_config difftool.trustExitCode false &&
146146
if test "${opt}" = '--dir-diff'

0 commit comments

Comments
 (0)