Skip to content

Commit

Permalink
Move tests inside clone.rs and fixed copyright headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
metajack committed Apr 5, 2013
1 parent b22a060 commit d375171
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
23 changes: 22 additions & 1 deletion src/libcore/clone.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down Expand Up @@ -73,3 +73,24 @@ clone_impl!(f64)

clone_impl!(bool)
clone_impl!(char)

#[test]
fn test_owned_clone() {
let a : ~int = ~5i;
let b : ~int = a.clone();
assert!(a == b);
}

#[test]
fn test_managed_clone() {
let a : @int = @5i;
let b : @int = a.clone();
assert!(a == b);
}

#[test]
fn test_managed_mut_clone() {
let a : @int = @5i;
let b : @int = a.clone();
assert!(a == b);
}
2 changes: 1 addition & 1 deletion src/test/run-pass/borrowck-borrow-from-expr-block.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down
27 changes: 0 additions & 27 deletions src/test/run-pass/clones.rs

This file was deleted.

5 comments on commit d375171

@bors
Copy link
Contributor

@bors bors commented on d375171 Apr 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from thestinger
at metajack@d375171

@bors
Copy link
Contributor

@bors bors commented on d375171 Apr 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors
Copy link
Contributor

@bors bors commented on d375171 Apr 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors
Copy link
Contributor

@bors bors commented on d375171 Apr 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on d375171 Apr 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = d09835d

Please sign in to comment.