Auto merge of #76368 - ayushmishra2005:move_str_contact_library, r=jyn514
Added str tests in library Added str tests in library as a part of #76268 r? @matklad
This commit is contained in:
commit
e114d6228b
@ -721,3 +721,11 @@ fn test_from_char() {
|
||||
let s: String = 'x'.into();
|
||||
assert_eq!(s, 'x'.to_string());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_str_concat() {
|
||||
let a: String = "hello".to_string();
|
||||
let b: String = "world".to_string();
|
||||
let s: String = format!("{}{}", a, b);
|
||||
assert_eq!(s.as_bytes()[9], 'd' as u8);
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
// run-pass
|
||||
|
||||
pub fn main() {
|
||||
let a: String = "hello".to_string();
|
||||
let b: String = "world".to_string();
|
||||
let s: String = format!("{}{}", a, b);
|
||||
println!("{}", s.clone());
|
||||
assert_eq!(s.as_bytes()[9], 'd' as u8);
|
||||
}
|
Loading…
Reference in New Issue
Block a user