//! Provides testing utility functions for use throughout the Rust code base. #[doc(hidden)] pub use pretty_assertions::assert_eq as _pretty_assert_eq; #[derive(PartialEq, Eq)] pub struct DebugAsDisplay(pub T); impl std::fmt::Debug for DebugAsDisplay { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { self.0.fmt(f) } } #[macro_export] macro_rules! assert_multiline_str_eq { ($a:expr, $b:expr) => { $crate::_pretty_assert_eq!($crate::DebugAsDisplay($a), $crate::DebugAsDisplay($b)) }; } /// a very simple implementation of En/DecoderFormatting to be embedded in roc source under test /// /// - numbers and bools are encoded as 'n' ' ' /// - strings are encoded as 's' ' ' ' ' /// - records are encoded as 'r' ' ' []* /// - lists and tuples are encoded as 'l' ' ' []* pub const TAG_LEN_ENCODER_FMT: &str = include_str!("TagLenEncoderFmt.roc");