diff options
Diffstat (limited to 'src/libcollectionstest/string.rs')
| -rw-r--r-- | src/libcollectionstest/string.rs | 11 |
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('华'); |
