about summary refs log tree commit diff
path: root/src/liballoc/boxed.rs
diff options
context:
space:
mode:
authorStepan Koltsov <stepan.koltsov@gmail.com>2015-01-20 23:57:56 +0300
committerStepan Koltsov <stepan.koltsov@gmail.com>2015-01-20 23:57:56 +0300
commitace2f09d3f89e20a7caa67bb0548212b07f696c2 (patch)
treeedc6911e50aff1b31c9fb2c0828835b82d816685 /src/liballoc/boxed.rs
parenta0f86de49748b472d4d189d9688b0d856c000914 (diff)
downloadrust-ace2f09d3f89e20a7caa67bb0548212b07f696c2.tar.gz
rust-ace2f09d3f89e20a7caa67bb0548212b07f696c2.zip
alloc::boxed: enable test
Previously test was disabled due to `#[cfg(test)]` before `mod boxed`.
Diffstat (limited to 'src/liballoc/boxed.rs')
-rw-r--r--src/liballoc/boxed.rs53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index a2cc98c7d01..de18d7a4a01 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -187,56 +187,3 @@ impl<T: ?Sized> DerefMut for Box<T> {
     fn deref_mut(&mut self) -> &mut T { &mut **self }
 }
 
-#[cfg(test)]
-mod test {
-    #[test]
-    fn test_owned_clone() {
-        let a = Box::new(5i);
-        let b: Box<int> = a.clone();
-        assert!(a == b);
-    }
-
-    #[test]
-    fn any_move() {
-        let a = Box::new(8u) as Box<Any>;
-        let b = Box::new(Test) as Box<Any>;
-
-        match a.downcast::<uint>() {
-            Ok(a) => { assert!(a == Box::new(8u)); }
-            Err(..) => panic!()
-        }
-        match b.downcast::<Test>() {
-            Ok(a) => { assert!(a == Box::new(Test)); }
-            Err(..) => panic!()
-        }
-
-        let a = Box::new(8u) as Box<Any>;
-        let b = Box::new(Test) as Box<Any>;
-
-        assert!(a.downcast::<Box<Test>>().is_err());
-        assert!(b.downcast::<Box<uint>>().is_err());
-    }
-
-    #[test]
-    fn test_show() {
-        let a = Box::new(8u) as Box<Any>;
-        let b = Box::new(Test) as Box<Any>;
-        let a_str = a.to_str();
-        let b_str = b.to_str();
-        assert_eq!(a_str, "Box<Any>");
-        assert_eq!(b_str, "Box<Any>");
-
-        let a = &8u as &Any;
-        let b = &Test as &Any;
-        let s = format!("{}", a);
-        assert_eq!(s, "&Any");
-        let s = format!("{}", b);
-        assert_eq!(s, "&Any");
-    }
-
-    #[test]
-    fn deref() {
-        fn homura<T: Deref<Target=i32>>(_: T) { }
-        homura(Box::new(765i32));
-    }
-}