Add test for string AddAssign
This commit is contained in:
parent
9316ae515e
commit
6ac83de691
1 changed files with 11 additions and 0 deletions
|
@ -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("ประเทศไทย中");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue