File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/catalyst-toolbox/catalyst-toolbox/src/ideascale/models/de Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,15 @@ pub fn clean_str(s: &str) -> String {
7272
7373#[ cfg( any( test, feature = "test-api" ) ) ]
7474mod tests {
75+ use proptest:: arbitrary:: any;
76+ use proptest:: prelude:: * ;
7577 use proptest:: {
7678 arbitrary:: { Arbitrary , StrategyFor } ,
7779 prelude:: * ,
7880 strategy:: Map ,
7981 } ;
8082 use serde_json:: json;
8183 use test_strategy:: proptest;
82- use proptest:: arbitrary:: any;
8384
8485 use super :: * ;
8586
@@ -92,6 +93,7 @@ mod tests {
9293 type Strategy = Map < StrategyFor < String > , fn ( String ) -> Self > ;
9394 }
9495
96+ #[ allow( dead_code) ]
9597 fn parse ( s : & str ) -> CleanString {
9698 let s = format ! ( r#""{s}""# ) ;
9799 serde_json:: from_str ( & s) . unwrap ( )
@@ -103,9 +105,11 @@ mod tests {
103105 assert_eq ! ( parse( "h*e-l/lo" ) , CleanString :: from( "hello" ) ) ;
104106 }
105107
106- #[ proptest]
107- fn any_string_deserializes_to_clean_string ( s : String ) {
108- let json = json ! ( s) ;
109- let _: CleanString = serde_json:: from_value ( json) . unwrap ( ) ;
108+ proptest ! {
109+ #[ test]
110+ fn any_string_deserializes_to_clean_string( s in any:: <String >( ) ) {
111+ let json = json!( s) ;
112+ let _: CleanString = serde_json:: from_value( json) . unwrap( ) ;
113+ }
110114 }
111115}
You can’t perform that action at this time.
0 commit comments