Silence non-implicitly-copyable-typarams in coretest

This commit is contained in:
Brian Anderson 2012-09-02 16:34:20 -07:00
parent ffa5d76a78
commit 49c9ac175f
8 changed files with 69 additions and 61 deletions

View File

@ -55,6 +55,7 @@ fn inflate_buf(buf: &[const u8]) -> ~[u8] {
}
#[test]
#[allow(non_implicitly_copyable_typarams)]
fn test_flate_round_trip() {
let r = rand::Rng();
let mut words = ~[];

View File

@ -174,66 +174,69 @@ proto! future_pipe (
}
)
#[test]
fn test_from_value() {
let f = from_value(~"snail");
assert get(&f) == ~"snail";
}
#[allow(non_implicitly_copyable_typarams)]
mod test {
#[test]
fn test_from_value() {
let f = from_value(~"snail");
assert get(&f) == ~"snail";
}
#[test]
fn test_from_port() {
let (po, ch) = future_pipe::init();
future_pipe::server::completed(ch, ~"whale");
let f = from_port(po);
assert get(&f) == ~"whale";
}
#[test]
fn test_from_port() {
let (po, ch) = future_pipe::init();
future_pipe::server::completed(ch, ~"whale");
let f = from_port(po);
assert get(&f) == ~"whale";
}
#[test]
fn test_from_fn() {
let f = from_fn(|| ~"brail");
assert get(&f) == ~"brail";
}
#[test]
fn test_from_fn() {
let f = from_fn(|| ~"brail");
assert get(&f) == ~"brail";
}
#[test]
fn test_interface_get() {
let f = from_value(~"fail");
assert f.get() == ~"fail";
}
#[test]
fn test_interface_get() {
let f = from_value(~"fail");
assert f.get() == ~"fail";
}
#[test]
fn test_with() {
let f = from_value(~"nail");
assert with(&f, |v| *v) == ~"nail";
}
#[test]
fn test_with() {
let f = from_value(~"nail");
assert with(&f, |v| copy *v) == ~"nail";
}
#[test]
fn test_get_ref_method() {
let f = from_value(22);
assert *f.get_ref() == 22;
}
#[test]
fn test_get_ref_method() {
let f = from_value(22);
assert *f.get_ref() == 22;
}
#[test]
fn test_get_ref_fn() {
let f = from_value(22);
assert *get_ref(&f) == 22;
}
#[test]
fn test_get_ref_fn() {
let f = from_value(22);
assert *get_ref(&f) == 22;
}
#[test]
fn test_interface_with() {
let f = from_value(~"kale");
assert f.with(|v| *v) == ~"kale";
}
#[test]
fn test_interface_with() {
let f = from_value(~"kale");
assert f.with(|v| copy *v) == ~"kale";
}
#[test]
fn test_spawn() {
let f = spawn(|| ~"bale");
assert get(&f) == ~"bale";
}
#[test]
fn test_spawn() {
let f = spawn(|| ~"bale");
assert get(&f) == ~"bale";
}
#[test]
#[should_fail]
#[ignore(cfg(target_os = "win32"))]
fn test_futurefail() {
let f = spawn(|| fail);
let _x: ~str = get(&f);
}
#[test]
#[should_fail]
#[ignore(cfg(target_os = "win32"))]
fn test_futurefail() {
let f = spawn(|| fail);
let _x: ~str = get(&f);
}
}

View File

@ -827,6 +827,7 @@ fn arch() -> ~str { ~"x86_64" }
fn arch() -> str { ~"arm" }
#[cfg(test)]
#[allow(non_implicitly_copyable_typarams)]
mod tests {
#[test]
@ -893,7 +894,7 @@ mod tests {
let e = env();
assert vec::len(e) > 0u;
for vec::each(e) |p| {
let (n, v) = p;
let (n, v) = copy p;
log(debug, n);
let v2 = getenv(n);
// MingW seems to set some funky environment variables like
@ -909,7 +910,7 @@ mod tests {
let mut e = env();
setenv(n, ~"VALUE");
assert !vec::contains(e, (n, ~"VALUE"));
assert !vec::contains(e, (copy n, ~"VALUE"));
e = env();
assert vec::contains(e, (n, ~"VALUE"));

View File

@ -376,6 +376,7 @@ impl<T:Eq,U:Eq> Result<T,U> : Eq {
}
#[cfg(test)]
#[allow(non_implicitly_copyable_typarams)]
mod tests {
fn op1() -> result::Result<int, ~str> { result::Ok(666) }

View File

@ -3099,7 +3099,7 @@ mod tests {
0x000a_u16 ]) ];
for vec::each(pairs) |p| {
let (s, u) = p;
let (s, u) = copy p;
assert to_utf16(s) == u;
assert from_utf16(u) == s;
assert from_utf16(to_utf16(s)) == s;

View File

@ -84,6 +84,7 @@ impl<A: ToStr> ~A: ToStr {
}
#[cfg(test)]
#[allow(non_implicitly_copyable_typarams)]
mod tests {
#[test]
fn test_simple_types() {

View File

@ -144,6 +144,7 @@ impl<A: Ord, B: Ord, C: Ord> (A, B, C): Ord {
}
#[test]
#[allow(non_implicitly_copyable_typarams)]
fn test_tuple() {
assert (948, 4039.48).first() == 948;
assert (34.5, ~"foo").second() == ~"foo";

View File

@ -2381,19 +2381,19 @@ mod tests {
let mut results: ~[~[int]];
results = ~[];
permute(~[], |v| vec::push(results, v));
permute(~[], |v| vec::push(results, copy v));
assert results == ~[~[]];
results = ~[];
permute(~[7], |v| results += ~[v]);
permute(~[7], |v| results += ~[copy v]);
assert results == ~[~[7]];
results = ~[];
permute(~[1,1], |v| results += ~[v]);
permute(~[1,1], |v| results += ~[copy v]);
assert results == ~[~[1,1],~[1,1]];
results = ~[];
permute(~[5,2,0], |v| results += ~[v]);
permute(~[5,2,0], |v| results += ~[copy v]);
assert results ==
~[~[5,2,0],~[5,0,2],~[2,5,0],~[2,0,5],~[0,5,2],~[0,2,5]];
}