Skip to content

broken test case of FormatSpec::format_int #4593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
broken test case of FormatSpec::format_int
  • Loading branch information
youknowone committed Feb 28, 2023
commit 98d8a31bf8a1ac78c9166d0c177165a7b718a8f7
10 changes: 10 additions & 0 deletions common/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,16 @@ mod tests {
);
}

#[test]
fn test_format_int_sep() {
let spec = FormatSpec::parse(",").expect("");
assert_eq!(spec.grouping_option, Some(FormatGrouping::Comma));
assert_eq!(
spec.format_int(&BigInt::from_str("1234567890123456789012345678").unwrap()),
Ok("1,234,567,890,123,456,789,012,345,678".to_owned())
);
}

#[test]
fn test_format_parse() {
let expected = Ok(FormatString {
Expand Down