Skip to content

Commit

Permalink
Rollup merge of rust-lang#35049 - knight42:add-test, r=alexcrichton
Browse files Browse the repository at this point in the history
Add a test for AddAssign on String

Fix rust-lang#35047
  • Loading branch information
steveklabnik authored Jul 30, 2016
2 parents 47a4be3 + 6ac83de commit bb01409
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libcollectionstest/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("ประเทศไทย中");
Expand Down

0 comments on commit bb01409

Please sign in to comment.