From 5a0a58bbef8d917bb6047a3125b236b2e311a383 Mon Sep 17 00:00:00 2001 From: Ayush Kumar Mishra Date: Sat, 5 Sep 2020 17:18:45 +0530 Subject: [PATCH] Added str tests in library --- library/alloc/tests/str.rs | 8 ++++++++ src/test/ui/str-concat.rs | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 src/test/ui/str-concat.rs diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs index b20cf076aca..411893d65de 100644 --- a/library/alloc/tests/str.rs +++ b/library/alloc/tests/str.rs @@ -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); +} diff --git a/src/test/ui/str-concat.rs b/src/test/ui/str-concat.rs deleted file mode 100644 index fa2fc97d7b8..00000000000 --- a/src/test/ui/str-concat.rs +++ /dev/null @@ -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); -}