about summary refs log tree commit diff
path: root/src/liballoc/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-08-31 01:16:17 +0000
committerbors <bors@rust-lang.org>2017-08-31 01:16:17 +0000
commit890c87b643264120dc1064ed73df6def974e02fc (patch)
treef47e5a797f4d2993b32b1490ff1b1cb0af297976 /src/liballoc/tests
parent7eeac1b81446c6327f1827ef334eca2db7fe28f7 (diff)
parentb9fea42b7aac3c3236dbff06244685e9ec102eb3 (diff)
downloadrust-890c87b643264120dc1064ed73df6def974e02fc.tar.gz
rust-890c87b643264120dc1064ed73df6def974e02fc.zip
Auto merge of #44186 - alexcrichton:rollup, r=alexcrichton
Rollup of 8 pull requests

- Successful merges: #44044, #44089, #44116, #44125, #44154, #44157, #44160, #44172
- Failed merges: #44162
Diffstat (limited to 'src/liballoc/tests')
-rw-r--r--src/liballoc/tests/string.rs22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs
index f5c124c6b44..6aba18ddf49 100644
--- a/src/liballoc/tests/string.rs
+++ b/src/liballoc/tests/string.rs
@@ -442,9 +442,8 @@ fn test_drain() {
 #[test]
 fn test_splice() {
     let mut s = "Hello, world!".to_owned();
-    let t: String = s.splice(7..12, "世界").collect();
+    s.splice(7..12, "世界");
     assert_eq!(s, "Hello, 世界!");
-    assert_eq!(t, "world");
 }
 
 #[test]
@@ -457,12 +456,10 @@ fn test_splice_char_boundary() {
 #[test]
 fn test_splice_inclusive_range() {
     let mut v = String::from("12345");
-    let t: String = v.splice(2...3, "789").collect();
+    v.splice(2...3, "789");
     assert_eq!(v, "127895");
-    assert_eq!(t, "34");
-    let t2: String = v.splice(1...2, "A").collect();
+    v.splice(1...2, "A");
     assert_eq!(v, "1A895");
-    assert_eq!(t2, "27");
 }
 
 #[test]
@@ -482,24 +479,15 @@ fn test_splice_inclusive_out_of_bounds() {
 #[test]
 fn test_splice_empty() {
     let mut s = String::from("12345");
-    let t: String = s.splice(1..2, "").collect();
+    s.splice(1..2, "");
     assert_eq!(s, "1345");
-    assert_eq!(t, "2");
 }
 
 #[test]
 fn test_splice_unbounded() {
     let mut s = String::from("12345");
-    let t: String = s.splice(.., "").collect();
+    s.splice(.., "");
     assert_eq!(s, "");
-    assert_eq!(t, "12345");
-}
-
-#[test]
-fn test_splice_forget() {
-    let mut s = String::from("12345");
-    ::std::mem::forget(s.splice(2..4, "789"));
-    assert_eq!(s, "12345");
 }
 
 #[test]