Rollup merge of #35049 - knight42:add-test, r=alexcrichton

Add a test for AddAssign on String

Fix #35047
This commit is contained in:
Manish Goregaokar 2016-07-30 13:44:46 +05:30 committed by GitHub
commit 96e3972707

View File

@ -192,6 +192,17 @@ fn test_push_str() {
assert_eq!(&s[0..], "abcประเทศไทย中华Việt Nam");
}
#[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("ประเทศไทย中");