mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 04:06:37 +03:00
In storage consistency checks, verify the junk filter has the expected word counts
Fix up a test or two. Simplify the XOR logic when we train the junk filter: Only if junk or nonjunk is set, but not when both (or none are set). i.e. when the values aren't the same. Locking the account when we do consistency checks prevents spurious test failures that may have been introduced in the previous commit.
This commit is contained in:
@ -6,8 +6,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/mjl-/bstore"
|
||||
|
||||
"github.com/mjl-/mox/dns"
|
||||
"github.com/mjl-/mox/smtp"
|
||||
"github.com/mjl-/mox/smtpclient"
|
||||
@ -279,10 +277,7 @@ test email
|
||||
})
|
||||
|
||||
// Mark message as junk.
|
||||
q := bstore.QueryDB[store.Message](ctxbg, ts.acc.DB)
|
||||
n, err := q.UpdateFields(map[string]any{"Junk": true})
|
||||
tcheck(t, err, "mark as junk")
|
||||
tcompare(t, n, 1)
|
||||
ts.xops.MessageFlagsAdd(ctxbg, pkglog, ts.acc, []int64{1}, []string{"$Junk"})
|
||||
|
||||
ts.run(func(client *smtpclient.Client) {
|
||||
mailFrom := "mjl@mox.example"
|
||||
|
Reference in New Issue
Block a user