File tree Expand file tree Collapse file tree 3 files changed +23
-29
lines changed
Expand file tree Collapse file tree 3 files changed +23
-29
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+ // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22// file at the top-level directory of this distribution and at
33// http://rust-lang.org/COPYRIGHT.
44//
@@ -73,3 +73,24 @@ clone_impl!(f64)
7373
7474clone_impl ! ( bool )
7575clone_impl ! ( char )
76+
77+ #[ test]
78+ fn test_owned_clone ( ) {
79+ let a : ~int = ~5 i;
80+ let b : ~int = a. clone ( ) ;
81+ assert ! ( a == b) ;
82+ }
83+
84+ #[ test]
85+ fn test_managed_clone ( ) {
86+ let a : @int = @5 i;
87+ let b : @int = a. clone ( ) ;
88+ assert ! ( a == b) ;
89+ }
90+
91+ #[ test]
92+ fn test_managed_mut_clone ( ) {
93+ let a : @int = @5 i;
94+ let b : @int = a. clone ( ) ;
95+ assert ! ( a == b) ;
96+ }
Original file line number Diff line number Diff line change 1- // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+ // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22// file at the top-level directory of this distribution and at
33// http://rust-lang.org/COPYRIGHT.
44//
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments