Skip to content

Commit 255889e

Browse files
committed
Move format-ref-cell test
1 parent 766377b commit 255889e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/tests/cell.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,11 @@ fn refcell_replace_borrows() {
414414
let _b = x.borrow();
415415
x.replace(1);
416416
}
417+
418+
#[test]
419+
fn refcell_format() {
420+
let name = RefCell::new("rust");
421+
let what = RefCell::new("rocks");
422+
let msg = format!("{name} {}", &*what.borrow(), name = &*name.borrow());
423+
assert_eq!(msg, "rust rocks".to_string());
424+
}

0 commit comments

Comments
 (0)