Skip to content

Commit 6ac83de

Browse files
author
Knight
committed
Add test for string AddAssign
1 parent 9316ae5 commit 6ac83de

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libcollectionstest/string.rs

+11
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,17 @@ fn test_push_str() {
192192
assert_eq!(&s[0..], "abcประเทศไทย中华Việt Nam");
193193
}
194194

195+
#[test]
196+
fn test_add_assign() {
197+
let mut s = String::new();
198+
s += "";
199+
assert_eq!(s.as_str(), "");
200+
s += "abc";
201+
assert_eq!(s.as_str(), "abc");
202+
s += "ประเทศไทย中华Việt Nam";
203+
assert_eq!(s.as_str(), "abcประเทศไทย中华Việt Nam");
204+
}
205+
195206
#[test]
196207
fn test_push() {
197208
let mut data = String::from("ประเทศไทย中");

0 commit comments

Comments
 (0)