about summary refs log tree commit diff
path: root/library/alloc/tests
diff options
context:
space:
mode:
authorAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-09-05 17:18:45 +0530
committerAyush Kumar Mishra <ayush.k.mishra@xcelenergy.com>2020-09-05 17:18:45 +0530
commit5a0a58bbef8d917bb6047a3125b236b2e311a383 (patch)
treefb3c3aad55b64df724f319f7de6a2d4ebf03b12b /library/alloc/tests
parentc3364780d2cfddfe329f62a3ec138fd4f9a60e27 (diff)
downloadrust-5a0a58bbef8d917bb6047a3125b236b2e311a383.tar.gz
rust-5a0a58bbef8d917bb6047a3125b236b2e311a383.zip
Added str tests in library
Diffstat (limited to 'library/alloc/tests')
-rw-r--r--library/alloc/tests/str.rs8
1 files changed, 8 insertions, 0 deletions
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);
+}