Added str tests in library
This commit is contained in:
parent
c3364780d2
commit
5a0a58bbef
@ -1921,3 +1921,11 @@ fn different_str_pattern_forwarding_lifetimes() {
|
||||
|
||||
foo::<&str>("x");
|
||||
}
|
||||
|
||||
#[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