gameServer2/src/protocol/test.rs
changeset 13482 7f3289a239dd
parent 13478 d79795acaa73
child 13520 1ee192f13456
--- a/gameServer2/src/protocol/test.rs	Mon Jul 09 20:31:32 2018 +0300
+++ b/gameServer2/src/protocol/test.rs	Mon Jul 09 20:59:08 2018 +0300
@@ -1,8 +1,7 @@
 use proptest::{
     test_runner::{TestRunner, Reason},
     arbitrary::{any, any_with, Arbitrary, StrategyFor},
-    strategy::{Strategy, BoxedStrategy, Just, Filter, ValueTree},
-    string::RegexGeneratorValueTree,
+    strategy::{Strategy, BoxedStrategy, Just, Map},
 };
 
 use server::coretypes::{GameCfg, TeamInfo, HedgehogInfo};
@@ -55,14 +54,7 @@
     type Parameters = <String as Arbitrary>::Parameters;
 
     fn arbitrary_with(args: Self::Parameters) -> Self::Strategy {
-        any_with::<String>(args)
-            .prop_filter("not ascii", |s| {
-                s.len() > 0 && s.is_ascii() &&
-                    s.find(|c| {
-                        ['\0', '\n', '\x20'].contains(&c)
-                    }).is_none()})
-            .prop_map(Ascii)
-            .boxed()
+        "[a-zA-Z0-9]+".prop_map(Ascii).boxed()
     }
 
     type Strategy = BoxedStrategy<Ascii>;