~ubuntu-branches/ubuntu/oneiric/bogofilter/oneiric

« back to all changes in this revision

Viewing changes to src/tests/t.encoding

  • Committer: Bazaar Package Importer
  • Author(s): Tollef Fog Heen
  • Date: 2005-11-10 11:49:05 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051110114905-s0dfdxew1kaonhyw
Tags: 0.96.5-1ubuntu1
* Resynchronise with Debian.
  - bogofilter-qdbm still disabled, bogofilter-tdb went away upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
$BOGOUTIL -C -y 0 -m ${WORDLIST} --unicode=no
85
85
$BOGOUTIL -C -y 0 -d ${WORDLIST} | sort > ${TMPDIR}/wordlist.old.txt
86
86
 
87
 
cat <<EOF | sed "s/ $DATE//" > ${TMPDIR}/md5sum.ref
88
 
4ff193bff18e44bd6af0992497565df2 -   wordlist.iconv.txt
89
 
4ff193bff18e44bd6af0992497565df2 -   wordlist.new.txt
90
 
a36783e5753e6254167ffe32835e96d0 -   wordlist.no.txt
91
 
a36783e5753e6254167ffe32835e96d0 -   wordlist.old.txt
92
 
a36783e5753e6254167ffe32835e96d0 -   wordlist.raw.txt
93
 
4ff193bff18e44bd6af0992497565df2 -   wordlist.yes.txt
 
87
echo "This is a test." >${TMPDIR}/empty.txt
 
88
if ! cksum >${TMPDIR}/empty.sum ${TMPDIR}/empty.txt ; then
 
89
    echo >&2 'cksum utility not found'
 
90
    exit 77
 
91
fi
 
92
tr '    ' ' ' <${TMPDIR}/empty.sum|cut -d " " -f 1-2 >${TMPDIR}/empty.sumonly
 
93
if ! echo "2711662207 16" | cmp -s - ${TMPDIR}/empty.sumonly
 
94
then
 
95
    echo >&2 'cksum utility not POSIX compliant!'
 
96
    exit 1
 
97
fi
 
98
 
 
99
cat <<EOF | sed "s/ $DATE//" > ${TMPDIR}/cksum.ref
 
100
1059676362 909 wordlist.iconv.txt
 
101
1059676362 909 wordlist.new.txt
 
102
3303802408 880 wordlist.no.txt
 
103
3303802408 880 wordlist.old.txt
 
104
3303802408 880 wordlist.raw.txt
 
105
1059676362 909 wordlist.yes.txt
94
106
EOF
95
107
 
96
108
for FILE in ${TMPDIR}/wordlist.*.txt ; do
97
 
    ( echo `md5sum < $FILE` " " `basename $FILE` ) >>  ${TMPDIR}/md5sum.out
 
109
    cksum "$FILE" | $AWK '{ printf "%s %s ", $1, $2 }' >>${TMPDIR}/cksum.out
 
110
    basename "$FILE" >>${TMPDIR}/cksum.out
98
111
done
99
112
 
100
113
if [ $verbose -eq 0 ] ; then 
101
 
    cmp ${TMPDIR}/md5sum.ref ${TMPDIR}/md5sum.out
 
114
    cmp ${TMPDIR}/cksum.ref ${TMPDIR}/cksum.out
102
115
else
103
 
    diff ${TMPDIR}/md5sum.ref ${TMPDIR}/md5sum.out
 
116
    diff -s ${TMPDIR}/cksum.ref ${TMPDIR}/cksum.out
104
117
fi