#!/bin/sh

. ${srcdir=.}/t.frame


cat <<EOF > "$TMPDIR"/reference
# bogofilter version ...

robx        = 0.520000  # (5.20e-01)
robs        = 0.017800  # (1.78e-02)
min_dev     = 0.375000  # (3.75e-01)
ham_cutoff  = 0.450000  # (4.50e-01)
spam_cutoff = 0.990000  # (9.90e-01)
ns_esf      = 1.000000  # (1.00e+00)
sp_esf      = 1.000000  # (1.00e+00)

block-on-subnets  = No
encoding          = @ENCODING@
charset-default   = @DEFAULT_CHARSET@
replace-nonascii-characters = No
stats-in-header   = Yes
thresh-update     = 0.000000
timestamp         = Yes

spam-header-name  = X-Bogosity
spam-header-place = ''
spam-subject-tag  = ''
unsure-subject-tag = ''
header-format     = %h: %c, tests=bogofilter, spamicity=%p, version=%v
terse-format      = %1.1c %f
log-header-format = %h: %c, spamicity=%p, version=%v
log-update-format = register-%r, %w words, %m messages
spamicity-tags    = Spam, Ham, Unsure
spamicity-formats = %0.6f, %0.6f, %0.6f
EOF

$BOGOFILTER -C -Q | sed "s/# bogofilter version .*/# bogofilter version .../" > "$TMPDIR"/output

CORRECT="$TMPDIR"/reference

for OUT in "$TMPDIR"/output ; do
    if  [ $verbose -eq 0 ]; then
	cmp "$CORRECT" "$OUT"
    else
	diff $DIFF_BRIEF "$CORRECT" "$OUT"
    fi
done
