mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-05 04:15:06 +00:00
Change some tests that used binop autoderef.
This commit is contained in:
parent
1ba9af92bf
commit
e527140548
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
fn foo(a: @int, b: @int) -> int { ret a + b; }
|
fn foo(a: @int, b: @int) -> int { ret *a + *b; }
|
||||||
|
|
||||||
fn main() { let f1 = bind foo(@10, @12); assert (f1() == 22); }
|
fn main() { let f1 = bind foo(@10, @12); assert (f1() == 22); }
|
||||||
|
@ -53,9 +53,8 @@ fn test_char() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn test_box() {
|
fn test_box() {
|
||||||
assert (@10 == 10);
|
assert (@10 == @10);
|
||||||
assert (0xFF & @0xF0 == 0xF0);
|
assert (@{a: 1, b: 3} < @{a: 1, b: 4});
|
||||||
assert ({a: 1, b: 3} < @{a: 1, b: 4});
|
|
||||||
assert (@{a: 'x'} != @{a: 'y'});
|
assert (@{a: 'x'} != @{a: 'y'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let y: @uint = @10u;
|
let y: @uint = @10u;
|
||||||
let x = if false { y } else if (true) { y } else { y };
|
let x = if false { y } else if (true) { y } else { y };
|
||||||
assert (y == 10u);
|
assert (*y == 10u);
|
||||||
}
|
}
|
||||||
|
@ -7,5 +7,5 @@ fn reclift[T](t: &T) -> recbox[T] { ret {x: @t}; }
|
|||||||
fn main() {
|
fn main() {
|
||||||
let foo: int = 17;
|
let foo: int = 17;
|
||||||
let rbfoo: recbox[int] = reclift[int](foo);
|
let rbfoo: recbox[int] = reclift[int](foo);
|
||||||
assert (rbfoo.x == foo);
|
assert (*rbfoo.x == foo);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user