diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-07-30 13:44:46 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-30 13:44:46 +0530 |
| commit | 96e3972707a12aefd3ae3ceac71fe6009ccbb061 (patch) | |
| tree | 0f7456c4b070d560dbae0a452e718a1f7e81bad5 | |
| parent | 2ad98a0b42917dbb0914f458829db7511be168d4 (diff) | |
| parent | 6ac83de691c5eb180e2007fcbe3236fd359d2ab7 (diff) | |
| download | rust-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.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('华'); |
