Closed djc closed 1 year ago
The test
feature enables the mock resolver and disables all DNS lookups. I needed to be able to use this feature from outside the library but cargo
does not yet support automatically enabling features when running cargo test
. Anyway, I fixed it with the following workaround:
#[cfg(any(test, feature = "test"))]
The design in https://github.com/stalwartlabs/mail-auth/commit/4383fcc008014d0ebf2e798166de0166f9aa2982 seems a little surprising. What is the
test
feature intended to do? Is there a reason not to use#[cfg(test)]
directly? It seems kinda strange that running the tests requires thetest
feature (otherwise a bunch of tests fail). Usually Cargo features should be additive, such that code compiles (and passes tests) whether the feature is enabled or not.