about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-05-15 02:23:12 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-05-15 04:34:31 -0400
commitcda3ac905a56dc6580429eea259143d30a7f3c02 (patch)
treeb71277c4f5f656e7ecd3d8496465c96aa28b89d9 /src/libstd
parent75822f2894498025d6a86bcaf30fa56118c7d3ab (diff)
downloadrust-cda3ac905a56dc6580429eea259143d30a7f3c02.tar.gz
rust-cda3ac905a56dc6580429eea259143d30a7f3c02.zip
rc: fix tests
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/rc.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/libstd/rc.rs b/src/libstd/rc.rs
index 41fcc1d402e..cb0798f2a39 100644
--- a/src/libstd/rc.rs
+++ b/src/libstd/rc.rs
@@ -103,28 +103,20 @@ mod test_rc {
     fn test_clone() {
         let x = Rc::new(Cell(5));
         let y = x.clone();
-        do x.with_borrow |cell| {
-            do value.with_mut_ref |inner| {
-                *inner = 20;
-            }
-        }
-        do y.with_borrow |value| {
-            assert_eq!(value.take(), 20);
+        do x.borrow().with_mut_ref |inner| {
+            *inner = 20;
         }
+        assert_eq!(y.borrow().take(), 20);
     }
 
     #[test]
     fn test_deep_clone() {
         let x = Rc::new(Cell(5));
         let y = x.deep_clone();
-        do x.with_borrow |cell| {
-            do value.with_mut_ref |inner| {
-                *inner = 20;
-            }
-        }
-        do y.with_borrow |value| {
-            assert_eq!(value.take(), 5);
+        do x.borrow().with_mut_ref |inner| {
+            *inner = 20;
         }
+        assert_eq!(y.borrow().take(), 5);
     }
 
     #[test]
@@ -134,7 +126,7 @@ mod test_rc {
     }
 
     #[test]
-    fn test_clone() {
+    fn test_simple_clone() {
         let x = Rc::new(5);
         let y = x.clone();
         assert_eq!(*x.borrow(), 5);