Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Feb 18, 2024
1 parent 47f6da9 commit 7592b04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/types/decimal192.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<SUT>(), Err(CommonError::DecimalError));
}
}

#[cfg(test)]
Expand Down
10 changes: 10 additions & 0 deletions src/core/types/locale_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
);
}
}

0 comments on commit 7592b04

Please sign in to comment.