X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?p=subdirmk.git;a=blobdiff_plain;f=tests%2Ffilter%2Fupdate-expected;h=d21ea73374f4fa319ec61dd66f3f9eb9b59d54b7;hp=ff105423fa427ffe1d68836c36fe76735f4fb9f9;hb=02276fc4ac88fc9cd85625c749ffe4305a8a69f8;hpb=f6e944b37d12b833c47a89b9988d9751c010af26 diff --git a/tests/filter/update-expected b/tests/filter/update-expected index ff10542..d21ea73 100755 --- a/tests/filter/update-expected +++ b/tests/filter/update-expected @@ -6,5 +6,13 @@ # selectively git-add the things that are right, after inspecting them set -e -files=$(find tests/filter -name \*.tmp) -for f in $files; do cp $f ${f%.tmp}.expected; done +files=$(find tests/filter -name \*.expected.tmp) +for f in $files; do + perl -pe ' + (s/\n//, $stripnl=0) if $stripnl; + next unless /^# doctests start/../^# doctests end/; + $_=""; + $stripnl=1; + ' \ + <${f%.expected.tmp}.tmp >${f%.tmp} +done