mod size_check { use flood_tide::err::OptParseError; use flood_tide::err::OptParseErrorKind; use flood_tide::err::OptParseErrors; // #[test] fn test_size() { assert_eq!(std::mem::size_of::(), 1); #[cfg(target_pointer_width = "64")] { assert_eq!(std::mem::size_of::(), 56); assert_eq!(std::mem::size_of::(), 24); // assert_eq!(std::mem::size_of::(), 24); assert_eq!(std::mem::size_of::>(), 24); } #[cfg(target_pointer_width = "32")] { assert_eq!(std::mem::size_of::(), 28); assert_eq!(std::mem::size_of::(), 12); // assert_eq!(std::mem::size_of::(), 12); assert_eq!(std::mem::size_of::>(), 12); } } } mod fmt_debug { use flood_tide::err::OptParseError; use flood_tide::err::OptParseErrorKind; use flood_tide::err::OptParseErrors; // #[test] fn opt_parse_error_kind() { let operrk = OptParseErrorKind::InvalidOption; let thing = format!("{:?}", operrk); let expect = "InvalidOption"; assert_eq!(thing, expect); } // #[test] fn opt_parse_error() { let operr = OptParseError::invalid_option("--abc"); let thing = format!("{:?}", operr); let expect = "OptParseError { kind: InvalidOption, desc1: \"--abc\", desc2: None }"; assert_eq!(thing, expect); } // #[test] fn opt_parse_errors() { let mut operrs = OptParseErrors::new(); operrs.push(OptParseError::invalid_option("--abc")); let thing = format!("{:?}", operrs); let expect = "OptParseErrors([OptParseError { kind: InvalidOption, desc1: \"--abc\", desc2: None }])"; assert_eq!(thing, expect); } }