Skip to content

Commit 2cde493

Browse files
committed
add test for char into string
1 parent 1d0378c commit 2cde493

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/liballoc/tests/string.rs

+7
Original file line numberDiff line numberDiff line change
@@ -714,3 +714,10 @@ fn test_try_reserve_exact() {
714714
}
715715
}
716716
}
717+
718+
#[test]
719+
fn test_from_char() {
720+
assert_eq!(String::from('a'), 'a'.to_string());
721+
let s: String = 'x'.into();
722+
assert_eq!(s, 'x'.to_string());
723+
}

0 commit comments

Comments
 (0)