Debian Codegraph @

tests/t391

raw
1 # t391 --- ident with Subversion-style keyword syntax
2 #
3 # Copyright (C) 2011-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 ident --help >/dev/null 2>&1 || exit 77
20 ident --help | grep '^Identify' >/dev/null || exit 77
21 split_std_out_err no
22
23 expected=$wd/expected
24 actual=$wd/actual
25 ierr=$wd/i.err
26 doubt=$wd/diff.out
27
28 ##
29 # Check ident with Subversion-style keyword syntax.
30 ##
31
32 $hey echo ' -*- org -*-'
33
34 try ()
35 {
36 # $1 -- name
37 # $2 -- file contents
38 # $3 -- expected output
39 name="$1"
40 echo "$2" > $w
41 echo "$3" | sed '1d;s/^|//;s/|$//' > $expected
42
43 $hey echo "* $name"
44 ident -q $w 1> $actual 2> $ierr
45 diff -u $expected $actual > $doubt
46 noiselessness_rules $doubt "$name"
47 noiselessness_rules $ierr "(stderr) $name"
48 }
49
50 try 'double-colon at beginning' '
51 $Foo: bar $ (OK -- traditional)
52 $Bar:: baz$ (WRONG -- NO SPACE BEFORE $)
53 $Bar:: baz $ (OK -- SPACE BEFORE $)
54 $Qux:: frobby zow#$ (OK -- HASH BEFORE $)' '
55 |t391.d/x:|
56 | $Foo: bar $|
57 | $Bar:: baz $|
58 | $Qux:: frobby zow#$|'
59
60 exit 0
61
62 # t391 ends here