d--j / go-milter

Go library to write mail filters
BSD 2-Clause "Simplified" License
12 stars 3 forks source link

Introduce interface mailfilter.Trx and a testing implementation testtrx.Trx #4

Closed d--j closed 1 year ago

d--j commented 1 year ago

With this new testtrx.Trx users of the mailfilter milter abstraction can easily write unit tests for their decision function. before this refactoring the decision function could not easily be unit tested because generating mailfilter.Transaction structs was not possible outside of this library.

BREAKING CHANGE: the mailfilter signatures changed significantly because we now pass a Trx interface to the decision function instead of a Transaction struct. The changes library users need to do are mostly calling methods instead of accessing public fields of the transaction.

coveralls commented 1 year ago

Coverage Status

Coverage: 84.724% (-0.5%) from 85.212% when pulling ca43cb225cc4640c1a41c20023e6e9ad9ee280d9 on testability into 96a68dcc0424e8942a00c42db6ce371f57863330 on main.