From 7592b044ccd461ac82b977e8bd3fb1bce89c75b9 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Sun, 18 Feb 2024 15:20:45 +0100 Subject: [PATCH] more tests --- src/core/types/decimal192.rs | 5 +++++ src/core/types/locale_config.rs | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/core/types/decimal192.rs b/src/core/types/decimal192.rs index 9a79a913d..80ffd2171 100644 --- a/src/core/types/decimal192.rs +++ b/src/core/types/decimal192.rs @@ -533,6 +533,11 @@ mod test_inner { let sut: SUT = s.parse().unwrap(); assert_eq!(sut.to_string(), s.to_owned()); } + + #[test] + fn from_str_invalid() { + assert_eq!("invalid".parse::(), Err(CommonError::DecimalError)); + } } #[cfg(test)] diff --git a/src/core/types/locale_config.rs b/src/core/types/locale_config.rs index 8ff1002a1..453116e71 100644 --- a/src/core/types/locale_config.rs +++ b/src/core/types/locale_config.rs @@ -89,4 +89,14 @@ mod tests { let sut = LocaleConfig::default(); assert_eq!(&sut.decimal_separator.unwrap(), "."); } + + #[test] + fn from_identifier_invalid() { + assert_eq!( + LocaleConfig::from_identifier("foo"), + Err(CommonError::UnrecognizedLocaleIdentifier { + bad_value: "foo".to_owned() + }) + ); + } }