comparison tests/test-include.sh @ 108:8b4924a9a072

Print diff
author Chris Cannam
date Thu, 02 Oct 2014 14:31:47 +0100
parents 2633976fbef5
children 0fe5abb56a6e
comparison
equal deleted inserted replaced
105:76d9d86ae6cd 108:8b4924a9a072
20 # a bit like the above, but ignoring first column (and without temp files) 20 # a bit like the above, but ignoring first column (and without temp files)
21 out=`cat "$1" "$2" | cut -d, -f2- | perl -p -e 's/(\d+\.\d{6})\d+/$1/' | sort | uniq -c | grep -v ' 2 '` 21 out=`cat "$1" "$2" | cut -d, -f2- | perl -p -e 's/(\d+\.\d{6})\d+/$1/' | sort | uniq -c | grep -v ' 2 '`
22 return `[ -z "$out" ]` 22 return `[ -z "$out" ]`
23 } 23 }
24 24
25 faildiff() {
26 echo "Test failed: $1"
27 if [ -n "$2" -a -n "$3" ]; then
28 echo "Output follows:"
29 echo "--"
30 cat $2
31 echo "--"
32 echo "Expected output follows:"
33 echo "--"
34 cat $3
35 echo "--"
36 echo "Diff:"
37 echo "--"
38 sdiff -w78 $2 $3
39 echo "--"
40 fi
41 exit 1
42 }
25 43
44