Rollup merge of #35049 - knight42:add-test, r=alexcrichton
Add a test for AddAssign on String Fix #35047
This commit is contained in:
commit
96e3972707
@ -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…
x
Reference in New Issue
Block a user