Skip to content

Commit 96d2521

Browse files
committed
Update format_args!() test to account for inlining.
1 parent 6a535df commit 96d2521

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/tests/fmt/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ fn test_pointer_formats_data_pointer() {
2222
#[test]
2323
fn test_estimated_capacity() {
2424
assert_eq!(format_args!("").estimated_capacity(), 0);
25-
assert_eq!(format_args!("{}", "").estimated_capacity(), 0);
25+
assert_eq!(format_args!("{}", {""}).estimated_capacity(), 0);
2626
assert_eq!(format_args!("Hello").estimated_capacity(), 5);
27-
assert_eq!(format_args!("Hello, {}!", "").estimated_capacity(), 16);
28-
assert_eq!(format_args!("{}, hello!", "World").estimated_capacity(), 0);
29-
assert_eq!(format_args!("{}. 16-bytes piece", "World").estimated_capacity(), 32);
27+
assert_eq!(format_args!("Hello, {}!", {""}).estimated_capacity(), 16);
28+
assert_eq!(format_args!("{}, hello!", {"World"}).estimated_capacity(), 0);
29+
assert_eq!(format_args!("{}. 16-bytes piece", {"World"}).estimated_capacity(), 32);
3030
}
3131

3232
#[test]

0 commit comments

Comments
 (0)