usecrate::proptest_fst::MAX_WEIGHT_VALUE;usecrate::semirings::TropicalWeight;usecrate::Semiring;useproptest::arbitrary::Arbitrary;useproptest::prelude::Strategy;useproptest::strategy::BoxedStrategy;#[derive(Debug, Clone)]pubstructProptestTropicalWeightConfig(usize);implDefault forProptestTropicalWeightConfig{fndefault()->Self{Self(MAX_WEIGHT_VALUE)}}implArbitrary forTropicalWeight{// Max weight value
typeParameters= ProptestTropicalWeightConfig;fnarbitrary_with(args:Self::Parameters)->Self::Strategy{(0..args.0).prop_map(move|weight_value|TropicalWeight::new(weight_value asf32)).boxed()}typeStrategy=BoxedStrategy<TropicalWeight>;}#[cfg(test)]modtests{usesuper::*;useproptest::prelude::*;proptest!{#[test]fntest_proptest_tropical_weight(tr in any::<TropicalWeight>()){prop_assert!(*tr.value()>=0.0&&*tr.value()<MAX_WEIGHT_VALUEasf32);}}}