mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Update format_args!() test to account for inlining.
This commit is contained in:
parent
6a535dfff4
commit
96d252160e
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user