equal
deleted
inserted
replaced
4 test_runner::{Reason, TestRunner}, |
4 test_runner::{Reason, TestRunner}, |
5 }; |
5 }; |
6 |
6 |
7 use crate::core::types::{GameCfg, HedgehogInfo, ServerVar, ServerVar::*, TeamInfo}; |
7 use crate::core::types::{GameCfg, HedgehogInfo, ServerVar, ServerVar::*, TeamInfo}; |
8 |
8 |
9 use super::messages::{HWProtocolMessage, HWProtocolMessage::*}; |
9 use super::messages::{HwProtocolMessage, HwProtocolMessage::*}; |
10 |
10 |
11 // Due to inability to define From between Options |
11 // Due to inability to define From between Options |
12 trait Into2<T>: Sized { |
12 trait Into2<T>: Sized { |
13 fn into2(self) -> T; |
13 fn into2(self) -> T; |
14 } |
14 } |
164 } |
164 } |
165 |
165 |
166 type Strategy = BoxedStrategy<ServerVar>; |
166 type Strategy = BoxedStrategy<ServerVar>; |
167 } |
167 } |
168 |
168 |
169 pub fn gen_proto_msg() -> BoxedStrategy<HWProtocolMessage> where { |
169 pub fn gen_proto_msg() -> BoxedStrategy<HwProtocolMessage> where { |
170 let res = (0..=55).no_shrink().prop_flat_map(|i| { |
170 let res = (0..=55).no_shrink().prop_flat_map(|i| { |
171 proto_msg_match!(i, def = Ping, |
171 proto_msg_match!(i, def = Ping, |
172 0 => Ping(), |
172 0 => Ping(), |
173 1 => Pong(), |
173 1 => Pong(), |
174 2 => Quit(Option<Ascii>), |
174 2 => Quit(Option<Ascii>), |