mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Add test for string AddAssign
This commit is contained in:
parent
9316ae515e
commit
6ac83de691
@ -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…
Reference in New Issue
Block a user