chiark / gitweb /
README: Adjust indent of &${..$..} expansion
[subdirmk.git] / tests / filter / update-expected
1 #!/bin/sh
2 # subdirmk - part of the test suite
3 #  Copyright 2019 Mark Wooding
4 #  Copyright 2019 Ian Jackson
5 # SPDX-License-Identifier: LGPL-2.0-or-later
6 # There is NO WARRANTY.
7 #
8 # Usual approach to updating the expected outputs is
9 #   tests/filter/check
10 #   tests/filter/update-expected
11 #   selectively git-add the things that are right, after inspecting them
12
13 set -e
14 files=$(find tests/filter -name \*.expected.tmp)
15 for f in $files; do
16         perl -pe '
17                 (s/\n//, $stripnl=0) if $stripnl;
18                 next unless /^# doctests start/../^# doctests end/;
19                 $_="";
20                 $stripnl=1;
21         ' \
22                 <${f%.expected.tmp}.tmp >${f%.tmp}
23 done