Files
magpie/internal/redact/export_test.go
T
yetone 033990e642 redact: the masking evaluation starts with nothing known
A value Mask masks is known from then on, and masked wherever it is
again (known.go), Preview's too. TestMaskEval ran after the tests that
masked hunter2pass, rina.k@fastmail.com and the like, so in the
package's full run what they masked was masked in its cases too, and
the rules' column was not the rules': with one test before it that
masked the eval's phones, rules read 19/34 for 16/34. Forget
(export_test.go) lets every value go before the cases.

180cfb565's body says 38 cases; there are 39.

Run: go test ./internal/redact (TestMaskEval in the full run and
alone: 16/34 rules either way) and ./internal/pii ok; go vet darwin,
linux, windows; gofmt -l clean.
Broken by hand: without Forget and with a test before it that masks
the eval's phones, rules read 19/34.
2026-10-25 17:44:52 +08:00

18 lines
487 B
Go

package redact
// ModelKinds is modelKinds, for the evaluation in package redact_test,
// which reads the real model through internal/pii (eval_test.go).
var ModelKinds = modelKinds
// Forget lets go of every value masked so far, so that what the
// evaluation scores is what its texts make masked, not what the tests
// before it masked and left known.
func Forget() {
mu.Lock()
values = map[string]string{}
shapes = map[string]string{}
reindexKnown()
mu.Unlock()
resetSent()
}