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 {
72
72
73
73
#[ cfg( any( test, feature = "test-api" ) ) ]
74
74
mod tests {
75
+ use proptest:: arbitrary:: any;
76
+ use proptest:: prelude:: * ;
75
77
use proptest:: {
76
78
arbitrary:: { Arbitrary , StrategyFor } ,
77
79
prelude:: * ,
78
80
strategy:: Map ,
79
81
} ;
80
82
use serde_json:: json;
81
83
use test_strategy:: proptest;
82
- use proptest:: arbitrary:: any;
83
84
84
85
use super :: * ;
85
86
@@ -92,6 +93,7 @@ mod tests {
92
93
type Strategy = Map < StrategyFor < String > , fn ( String ) -> Self > ;
93
94
}
94
95
96
+ #[ allow( dead_code) ]
95
97
fn parse ( s : & str ) -> CleanString {
96
98
let s = format ! ( r#""{s}""# ) ;
97
99
serde_json:: from_str ( & s) . unwrap ( )
@@ -103,9 +105,11 @@ mod tests {
103
105
assert_eq ! ( parse( "h*e-l/lo" ) , CleanString :: from( "hello" ) ) ;
104
106
}
105
107
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
+ }
110
114
}
111
115
}
You can’t perform that action at this time.
0 commit comments