Skip to content

Commit 82deaae

Browse files
tmzullingergitster
authored andcommitted
t0450: *.txt -> *.adoc fixes
After 1f010d6 (doc: use .adoc extension for AsciiDoc files, 2025-01-20), we no longer matched any files in this test. The result is that we did not test for mismatches in the documentation and --help output. Adjust the test to look at the renamed *.adoc files. Signed-off-by: Todd Zullinger <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 06d9252 commit 82deaae

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

t/t0450-txt-doc-vs-help.sh

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
test_description='assert (unbuilt) Documentation/*.txt and -h output
3+
test_description='assert (unbuilt) Documentation/*.adoc and -h output
44
55
Run this with --debug to see a summary of where we still fail to make
66
the two versions consistent with one another.'
@@ -11,11 +11,11 @@ test_expect_success 'setup: list of builtins' '
1111
git --list-cmds=builtins >builtins
1212
'
1313

14-
test_expect_success 'list of txt and help mismatches is sorted' '
15-
sort -u "$TEST_DIRECTORY"/t0450/txt-help-mismatches >expect &&
16-
if ! test_cmp expect "$TEST_DIRECTORY"/t0450/txt-help-mismatches
14+
test_expect_success 'list of adoc and help mismatches is sorted' '
15+
sort -u "$TEST_DIRECTORY"/t0450/adoc-help-mismatches >expect &&
16+
if ! test_cmp expect "$TEST_DIRECTORY"/t0450/adoc-help-mismatches
1717
then
18-
BUG "please keep the list of txt and help mismatches sorted"
18+
BUG "please keep the list of adoc and help mismatches sorted"
1919
fi
2020
'
2121

@@ -40,20 +40,20 @@ help_to_synopsis () {
4040
echo "$out"
4141
}
4242

43-
builtin_to_txt () {
44-
echo "$GIT_BUILD_DIR/Documentation/git-$1.txt"
43+
builtin_to_adoc () {
44+
echo "$GIT_BUILD_DIR/Documentation/git-$1.adoc"
4545
}
4646

47-
txt_to_synopsis () {
47+
adoc_to_synopsis () {
4848
builtin="$1" &&
4949
out_dir="out/$builtin" &&
50-
out="$out_dir/txt.synopsis" &&
50+
out="$out_dir/adoc.synopsis" &&
5151
if test -f "$out"
5252
then
5353
echo "$out" &&
5454
return 0
5555
fi &&
56-
b2t="$(builtin_to_txt "$builtin")" &&
56+
b2t="$(builtin_to_adoc "$builtin")" &&
5757
sed -n \
5858
-E '/^\[(verse|synopsis)\]$/,/^$/ {
5959
/^$/d;
@@ -109,29 +109,29 @@ do
109109
fi
110110
'
111111

112-
txt="$(builtin_to_txt "$builtin")" &&
113-
preq="$(echo BUILTIN_TXT_$builtin | tr '[:lower:]-' '[:upper:]_')" &&
112+
adoc="$(builtin_to_adoc "$builtin")" &&
113+
preq="$(echo BUILTIN_ADOC_$builtin | tr '[:lower:]-' '[:upper:]_')" &&
114114

115-
if test -f "$txt"
115+
if test -f "$adoc"
116116
then
117117
test_set_prereq "$preq"
118118
fi &&
119119

120-
# *.txt output assertions
121-
test_expect_success "$preq" "$builtin *.txt SYNOPSIS has dashed labels" '
122-
check_dashed_labels "$(txt_to_synopsis "$builtin")"
120+
# *.adoc output assertions
121+
test_expect_success "$preq" "$builtin *.adoc SYNOPSIS has dashed labels" '
122+
check_dashed_labels "$(adoc_to_synopsis "$builtin")"
123123
'
124124

125-
# *.txt output consistency assertions
125+
# *.adoc output consistency assertions
126126
result=
127-
if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/txt-help-mismatches
127+
if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/adoc-help-mismatches
128128
then
129129
result=failure
130130
else
131131
result=success
132132
fi &&
133133
test_expect_$result "$preq" "$builtin -h output and SYNOPSIS agree" '
134-
t2s="$(txt_to_synopsis "$builtin")" &&
134+
t2s="$(adoc_to_synopsis "$builtin")" &&
135135
if test "$builtin" = "merge-tree"
136136
then
137137
test_when_finished "rm -f t2s.new" &&
@@ -140,17 +140,17 @@ do
140140
fi &&
141141
h2s="$(help_to_synopsis "$builtin")" &&
142142
143-
# The *.txt and -h use different spacing for the
143+
# The *.adoc and -h use different spacing for the
144144
# alignment of continued usage output, normalize it.
145-
align_after_nl "$builtin" <"$t2s" >txt &&
145+
align_after_nl "$builtin" <"$t2s" >adoc &&
146146
align_after_nl "$builtin" <"$h2s" >help &&
147-
test_cmp txt help
147+
test_cmp adoc help
148148
'
149149

150-
if test_have_prereq "$preq" && test -e txt && test -e help
150+
if test_have_prereq "$preq" && test -e adoc && test -e help
151151
then
152152
test_debug '
153-
if test_cmp txt help >cmp 2>/dev/null
153+
if test_cmp adoc help >cmp 2>/dev/null
154154
then
155155
echo "=== DONE: $builtin ==="
156156
else
@@ -161,7 +161,7 @@ do
161161

162162
# Not in test_expect_success in case --run is being
163163
# used with --debug
164-
rm -f txt help tmp 2>/dev/null
164+
rm -f adoc help tmp 2>/dev/null
165165
fi
166166
done <builtins
167167

File renamed without changes.

0 commit comments

Comments
 (0)