test: Some test fixes

This commit is contained in:
Patrick Walton 2013-03-12 22:36:24 -07:00
parent 8fa66e8e07
commit ac60d53c65
8 changed files with 19 additions and 19 deletions

View file

@ -11,13 +11,13 @@
#[link(name="cci_impl_lib", vers="0.0")];
trait uint_helpers {
fn to(self, v: uint, f: &fn(uint));
fn to(&self, v: uint, f: &fn(uint));
}
impl uint_helpers for uint {
#[inline]
fn to(self, v: uint, f: &fn(uint)) {
let mut i = self;
fn to(&self, v: uint, f: &fn(uint)) {
let mut i = *self;
while i < v {
f(i);
i += 1u;

View file

@ -18,7 +18,7 @@ trait iterable<A> {
impl<A> iterable<A> for &self/[A] {
fn iterate(&self, f: &fn(x: &A) -> bool) {
for vec::each(self) |e| {
for vec::each(*self) |e| {
if !f(e) { break; }
}
}
@ -26,7 +26,7 @@ impl<A> iterable<A> for &self/[A] {
impl<A> iterable<A> for ~[A] {
fn iterate(&self, f: &fn(x: &A) -> bool) {
for vec::each(self) |e| {
for vec::each(*self) |e| {
if !f(e) { break; }
}
}

View file

@ -13,11 +13,11 @@ struct Foo {
}
trait Stuff {
fn printme(self);
fn printme(&self);
}
impl Stuff for &self/Foo {
fn printme(self) {
impl Stuff for Foo {
fn printme(&self) {
io::println(fmt!("%d", self.x));
}
}

View file

@ -9,11 +9,11 @@
// except according to those terms.
trait double {
fn double(self) -> uint;
fn double(@self) -> uint;
}
impl double for uint {
fn double(self) -> uint { self * 2u }
fn double(@self) -> uint { *self * 2u }
}
pub fn main() {

View file

@ -9,11 +9,11 @@
// except according to those terms.
trait double {
fn double(self) -> uint;
fn double(@self) -> uint;
}
impl double for @@uint {
fn double(self) -> uint { **self * 2u }
impl double for @uint {
fn double(@self) -> uint { **self * 2u }
}
pub fn main() {

View file

@ -9,11 +9,11 @@
// except according to those terms.
trait double {
fn double(self) -> uint;
fn double(@self) -> uint;
}
impl double for uint {
fn double(self) -> uint { self * 2u }
fn double(@self) -> uint { *self * 2u }
}
pub fn main() {

View file

@ -9,11 +9,11 @@
// except according to those terms.
trait double {
fn double(self) -> uint;
fn double(@self) -> uint;
}
impl double for uint {
fn double(self) -> uint { self * 2u }
fn double(@self) -> uint { *self * 2u }
}
pub fn main() {

View file

@ -9,11 +9,11 @@
// except according to those terms.
trait Foo {
fn foo(self);
fn foo(@self);
}
impl Foo for int {
fn foo(self) {
fn foo(@self) {
io::println("Hello world!");
}
}