about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-07-30 13:44:46 +0530
committerGitHub <noreply@github.com>2016-07-30 13:44:46 +0530
commit96e3972707a12aefd3ae3ceac71fe6009ccbb061 (patch)
tree0f7456c4b070d560dbae0a452e718a1f7e81bad5
parent2ad98a0b42917dbb0914f458829db7511be168d4 (diff)
parent6ac83de691c5eb180e2007fcbe3236fd359d2ab7 (diff)
downloadrust-96e3972707a12aefd3ae3ceac71fe6009ccbb061.tar.gz
rust-96e3972707a12aefd3ae3ceac71fe6009ccbb061.zip
Rollup merge of #35049 - knight42:add-test, r=alexcrichton
Add a test for AddAssign on String

Fix #35047
-rw-r--r--src/libcollectionstest/string.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libcollectionstest/string.rs b/src/libcollectionstest/string.rs
index 7f0fd282ae5..1652fb5a88d 100644
--- a/src/libcollectionstest/string.rs
+++ b/src/libcollectionstest/string.rs
@@ -193,6 +193,17 @@ fn test_push_str() {
 }
 
 #[test]
+fn test_add_assign() {
+    let mut s = String::new();
+    s += "";
+    assert_eq!(s.as_str(), "");
+    s += "abc";
+    assert_eq!(s.as_str(), "abc");
+    s += "ประเทศไทย中华Việt Nam";
+    assert_eq!(s.as_str(), "abcประเทศไทย中华Việt Nam");
+}
+
+#[test]
 fn test_push() {
     let mut data = String::from("ประเทศไทย中");
     data.push('华');