]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #8305 : huonw/rust/triage-fixes, r=cmr
authorbors <bors@rust-lang.org>
Wed, 7 Aug 2013 13:56:19 +0000 (06:56 -0700)
committerbors <bors@rust-lang.org>
Wed, 7 Aug 2013 13:56:19 +0000 (06:56 -0700)
The two deletions are because the test cases are very old (still using `class` and modes!), and, as far as I can tell (since they are so old), the areas they test are well tested by other rpass tests.

1  2 
src/libstd/str.rs

diff --combined src/libstd/str.rs
index b4057b85cbfef5cbfae74b54555c359c3e9f5376,55faf7e319295dec75ab0ce80f1f09a1d8f1078a..cd7aac020edef4440212f4917aaa9756734e7862
@@@ -885,7 -885,7 +885,7 @@@ pub mod raw 
      /// If begin is greater than end.
      /// If end is greater than the length of the string.
      #[inline]
 -    pub unsafe fn slice_bytes(s: &str, begin: uint, end: uint) -> &str {
 +    pub unsafe fn slice_bytes<'a>(s: &'a str, begin: uint, end: uint) -> &'a str {
          do s.as_imm_buf |sbuf, n| {
               assert!((begin <= end));
               assert!((end <= n));
@@@ -3304,19 -3304,22 +3304,22 @@@ mod tests 
      fn test_add() {
          #[allow(unnecessary_allocation)];
          macro_rules! t (
-             ($s1:expr, $s2:expr, $e:expr) => {
-                 assert_eq!($s1 + $s2, $e);
-                 assert_eq!($s1.to_owned() + $s2, $e);
-                 assert_eq!($s1.to_managed() + $s2, $e);
-             }
+             ($s1:expr, $s2:expr, $e:expr) => { {
+                 let s1 = $s1;
+                 let s2 = $s2;
+                 let e = $e;
+                 assert_eq!(s1 + s2, e.to_owned());
+                 assert_eq!(s1.to_owned() + s2, e.to_owned());
+                 assert_eq!(s1.to_managed() + s2, e.to_owned());
+             } }
          );
  
-         t!("foo",  "bar", ~"foobar");
-         t!("foo", @"bar", ~"foobar");
-         t!("foo", ~"bar", ~"foobar");
-         t!("ศไทย中",  "华Việt Nam", ~"ศไทย中华Việt Nam");
-         t!("ศไทย中", @"华Việt Nam", ~"ศไทย中华Việt Nam");
-         t!("ศไทย中", ~"华Việt Nam", ~"ศไทย中华Việt Nam");
+         t!("foo",  "bar", "foobar");
+         t!("foo", @"bar", "foobar");
+         t!("foo", ~"bar", "foobar");
+         t!("ศไทย中",  "华Việt Nam", "ศไทย中华Việt Nam");
+         t!("ศไทย中", @"华Việt Nam", "ศไทย中华Việt Nam");
+         t!("ศไทย中", ~"华Việt Nam", "ศไทย中华Việt Nam");
      }
  
      #[test]