macro_rules! assert_message_to_str {
(__ $m:expr, $s:expr) => {{
pretty_assertions::assert_eq!($crate::Message::from($m.clone()).to_string(), $s);
pretty_assertions::assert_eq!($m.to_string(), $s);
}};
(gui $m:expr, $s:expr) => {{
$crate::dev_macros::assert_message_to_str!(__ $m, $s);
pretty_assertions::assert_eq!($crate::gui::Message::from($m).to_string(), $s);
}};
(engine $m:expr, $s:expr) => {{
$crate::dev_macros::assert_message_to_str!(__ $m, $s);
pretty_assertions::assert_eq!($crate::engine::Message::from($m).to_string(), $s);
}};
}
pub(crate) use assert_message_to_str;
macro_rules! assert_from_str_message {
(__ $s:expr, $m:expr) => {{
use ::core::str::FromStr;
pretty_assertions::assert_eq!($crate::Message::from_str($s), $m.map(|ok| $crate::Message::from(ok)));
pretty_assertions::assert_eq!(FromStr::from_str($s), $m);
}};
(gui $s:expr, $m:expr) => {{
use ::core::str::FromStr;
$crate::dev_macros::assert_from_str_message!(__ $s, $m);
pretty_assertions::assert_eq!($crate::gui::Message::from_str($s), $m.map(|ok| $crate::gui::Message::from(ok)));
}};
(engine $s:expr, $m:expr) => {{
use ::core::str::FromStr;
$crate::dev_macros::assert_from_str_message!(__ $s, $m);
pretty_assertions::assert_eq!($crate::engine::Message::from_str($s), $m.map(|ok| $crate::engine::Message::from(ok)));
}};
}
pub(crate) use assert_from_str_message;
macro_rules! assert_message_to_from_str {
(gui $m:expr, $s:expr) => {{
$crate::dev_macros::assert_from_str_message!(gui $s, Ok($m.clone()));
$crate::dev_macros::assert_message_to_str!(gui $m, $s);
}};
(engine $m:expr, $s:expr) => {{
$crate::dev_macros::assert_from_str_message!(engine $s, Ok($m.clone()));
$crate::dev_macros::assert_message_to_str!(engine $m, $s);
}};
}
pub(crate) use assert_message_to_from_str;