Update format_args!() test to account for inlining.

This commit is contained in:
Mara Bos 2023-01-13 19:21:36 +01:00
parent 6a535dfff4
commit 96d252160e

View File

@ -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]