mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-11 01:17:39 +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]
|
#[test]
|
||||||
fn test_estimated_capacity() {
|
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!("{}", {""}).estimated_capacity(), 0);
|
||||||
assert_eq!(format_args!("Hello").estimated_capacity(), 5);
|
assert_eq!(format_args!("Hello").estimated_capacity(), 5);
|
||||||
assert_eq!(format_args!("Hello, {}!", "").estimated_capacity(), 16);
|
assert_eq!(format_args!("Hello, {}!", {""}).estimated_capacity(), 16);
|
||||||
assert_eq!(format_args!("{}, hello!", "World").estimated_capacity(), 0);
|
assert_eq!(format_args!("{}, hello!", {"World"}).estimated_capacity(), 0);
|
||||||
assert_eq!(format_args!("{}. 16-bytes piece", "World").estimated_capacity(), 32);
|
assert_eq!(format_args!("{}. 16-bytes piece", {"World"}).estimated_capacity(), 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user