1
1
#! /bin/sh
2
2
3
- test_description=' assert (unbuilt) Documentation/*.txt and -h output
3
+ test_description=' assert (unbuilt) Documentation/*.adoc and -h output
4
4
5
5
Run this with --debug to see a summary of where we still fail to make
6
6
the two versions consistent with one another.'
@@ -11,11 +11,11 @@ test_expect_success 'setup: list of builtins' '
11
11
git --list-cmds=builtins >builtins
12
12
'
13
13
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
17
17
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"
19
19
fi
20
20
'
21
21
@@ -40,20 +40,20 @@ help_to_synopsis () {
40
40
echo " $out "
41
41
}
42
42
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 "
45
45
}
46
46
47
- txt_to_synopsis () {
47
+ adoc_to_synopsis () {
48
48
builtin=" $1 " &&
49
49
out_dir=" out/$builtin " &&
50
- out=" $out_dir /txt .synopsis" &&
50
+ out=" $out_dir /adoc .synopsis" &&
51
51
if test -f " $out "
52
52
then
53
53
echo " $out " &&
54
54
return 0
55
55
fi &&
56
- b2t=" $( builtin_to_txt " $builtin " ) " &&
56
+ b2t=" $( builtin_to_adoc " $builtin " ) " &&
57
57
sed -n \
58
58
-E ' /^\[(verse|synopsis)\]$/,/^$/ {
59
59
/^$/d;
109
109
fi
110
110
'
111
111
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:]_' ) " &&
114
114
115
- if test -f " $txt "
115
+ if test -f " $adoc "
116
116
then
117
117
test_set_prereq " $preq "
118
118
fi &&
119
119
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")"
123
123
'
124
124
125
- # *.txt output consistency assertions
125
+ # *.adoc output consistency assertions
126
126
result=
127
- if grep -q " ^$builtin $" " $TEST_DIRECTORY " /t0450/txt -help-mismatches
127
+ if grep -q " ^$builtin $" " $TEST_DIRECTORY " /t0450/adoc -help-mismatches
128
128
then
129
129
result=failure
130
130
else
131
131
result=success
132
132
fi &&
133
133
test_expect_$result " $preq " " $builtin -h output and SYNOPSIS agree" '
134
- t2s="$(txt_to_synopsis "$builtin")" &&
134
+ t2s="$(adoc_to_synopsis "$builtin")" &&
135
135
if test "$builtin" = "merge-tree"
136
136
then
137
137
test_when_finished "rm -f t2s.new" &&
140
140
fi &&
141
141
h2s="$(help_to_synopsis "$builtin")" &&
142
142
143
- # The *.txt and -h use different spacing for the
143
+ # The *.adoc and -h use different spacing for the
144
144
# alignment of continued usage output, normalize it.
145
- align_after_nl "$builtin" <"$t2s" >txt &&
145
+ align_after_nl "$builtin" <"$t2s" >adoc &&
146
146
align_after_nl "$builtin" <"$h2s" >help &&
147
- test_cmp txt help
147
+ test_cmp adoc help
148
148
'
149
149
150
- if test_have_prereq " $preq " && test -e txt && test -e help
150
+ if test_have_prereq " $preq " && test -e adoc && test -e help
151
151
then
152
152
test_debug '
153
- if test_cmp txt help >cmp 2>/dev/null
153
+ if test_cmp adoc help >cmp 2>/dev/null
154
154
then
155
155
echo "=== DONE: $builtin ==="
156
156
else
161
161
162
162
# Not in test_expect_success in case --run is being
163
163
# used with --debug
164
- rm -f txt help tmp 2> /dev/null
164
+ rm -f adoc help tmp 2> /dev/null
165
165
fi
166
166
done < builtins
167
167
0 commit comments