Debian Codegraph @

tests/t500

raw
1 # t500 --- does ‘rcs -i -kSUBST’ set the ‘expand’ keyword?
2 #
3 # Copyright (C) 2016-2022 Thien-Thi Nguyen
4 #
5 # This program is free software: you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation, either version 3 of
8 # the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty
12 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 # See the GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 . $srcdir/common
19 split_std_out_err no
20
21 ##
22 # Check that ‘rcs -i -kSUBST’ (SUBST ∈ {kvl, k, v, o, b})
23 # sets the ‘expand’ admin-node keyword in the RCS file.
24 # When SUBST is ‘kv’, however, check that it is NOT set.
25 ##
26
27 try ()
28 {
29 # $1 -- substitution mode
30 # $2 -- expected grep result (0: success, 1: failure)
31 k=$1
32 exp=$2
33
34 rm -f $w $v
35 must "rcs -i -t-$k -k$k $w"
36 grep "expand.*@$k@" $v 1>/dev/null
37 res=$?
38 if ! [ $res = $exp ] ; then
39 case $exp in
40 0) badness='missing' ;;
41 *) badness='spurious' ;;
42 esac
43 bad_RCSfile "$badness @$k@"
44 fi
45 }
46
47 try kv 1
48 try kvl 0
49 try k 0
50 try v 0
51 try o 0
52 try b 0
53
54 exit 0
55
56 # t500 ends here