with_features

Attribute Macro with_features 

Source
#[with_features]
Expand description

Enable the specified features for use in tests.

This macro calls featureflag::evaluator::set_thread_evaluator, so it should only be used for single-threaded tests.

Feature values can be any value that implements the featureflag_test::TestFeature trait.

ยงExamples

#[test]
#[with_features("enabled" = true, "disabled" = false)]
fn my_test() {
  assert!(featureflag::is_enabled("enabled"));
  assert!(!featureflag::is_enabled("disabled"));
}