Debian Codegraph @

tests/t606

raw
1 # t606 --- lock/unlock with integrity
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 split_std_out_err no
20
21 ##
22 # Check that lock/unlock leaves the ‘integrity’ field unchanged.
23 ##
24
25 cat > $wd/insert <<EOF
26 integrity
27 @@
28 ;
29 EOF
30
31 must 'sed -e "/^locks/r $wd/insert" `bundled_commav one` > $v'
32
33 try ()
34 {
35 # $1 -- command
36 command="$1"
37
38 must "$command $w $v"
39 must 'sed '\''/integrity/,/^;$/!d'\'' $v > $wd/cut'
40 diff $wd/insert $wd/cut > $wd/diff.out
41 noiselessness_rules $wd/diff.out "$command"
42 }
43
44 try 'co -l'
45 must 'echo more >> $w'
46 try 'ci -u -mmore'
47
48 exit 0
49
50 # t606 ends here