use crate::platform::{Platform, PlatformSpec, TargetFeatures};
use proptest::prelude::*;
impl PlatformSpec {
pub fn strategy(platform: impl Strategy<Value = Platform>) -> impl Strategy<Value = Self> {
prop_oneof![
1 => Just(PlatformSpec::Any),
1 => Just(PlatformSpec::Always),
2 => platform.prop_map(PlatformSpec::from),
]
}
}
impl Arbitrary for PlatformSpec {
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
Self::strategy(Platform::strategy(any::<TargetFeatures>())).boxed()
}
}