mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Update format_args!() test to account for inlining.
This commit is contained in:
@@ -22,11 +22,11 @@ fn test_pointer_formats_data_pointer() {
|
||||
#[test]
|
||||
fn test_estimated_capacity() {
|
||||
assert_eq!(format_args!("").estimated_capacity(), 0);
|
||||
assert_eq!(format_args!("{}", "").estimated_capacity(), 0);
|
||||
assert_eq!(format_args!("{}", {""}).estimated_capacity(), 0);
|
||||
assert_eq!(format_args!("Hello").estimated_capacity(), 5);
|
||||
assert_eq!(format_args!("Hello, {}!", "").estimated_capacity(), 16);
|
||||
assert_eq!(format_args!("{}, hello!", "World").estimated_capacity(), 0);
|
||||
assert_eq!(format_args!("{}. 16-bytes piece", "World").estimated_capacity(), 32);
|
||||
assert_eq!(format_args!("Hello, {}!", {""}).estimated_capacity(), 16);
|
||||
assert_eq!(format_args!("{}, hello!", {"World"}).estimated_capacity(), 0);
|
||||
assert_eq!(format_args!("{}. 16-bytes piece", {"World"}).estimated_capacity(), 32);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user