Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d375171

Browse files
committedApr 5, 2013
Move tests inside clone.rs and fixed copyright headers.
1 parent b22a060 commit d375171

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed
 

‎src/libcore/clone.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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

7474
clone_impl!(bool)
7575
clone_impl!(char)
76+
77+
#[test]
78+
fn test_owned_clone() {
79+
let a : ~int = ~5i;
80+
let b : ~int = a.clone();
81+
assert!(a == b);
82+
}
83+
84+
#[test]
85+
fn test_managed_clone() {
86+
let a : @int = @5i;
87+
let b : @int = a.clone();
88+
assert!(a == b);
89+
}
90+
91+
#[test]
92+
fn test_managed_mut_clone() {
93+
let a : @int = @5i;
94+
let b : @int = a.clone();
95+
assert!(a == b);
96+
}

‎src/test/run-pass/borrowck-borrow-from-expr-block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
//

‎src/test/run-pass/clones.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

5 commit comments

Comments
 (5)

bors commented on Apr 6, 2013

@bors
Collaborator

saw approval from thestinger
at metajack@d375171

bors commented on Apr 6, 2013

@bors
Collaborator

merging metajack/rust/at-clones = d375171 into auto

bors commented on Apr 6, 2013

@bors
Collaborator

metajack/rust/at-clones = d375171 merged ok, testing candidate = d09835d

bors commented on Apr 6, 2013

@bors
Collaborator

fast-forwarding incoming to auto = d09835d

Please sign in to comment.