mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Add assertions to test
This commit is contained in:
parent
c4b4cb36c8
commit
29ab2daa5e
@ -8,12 +8,14 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#[deriving(Eq)]
|
||||||
struct Foo(int);
|
struct Foo(int);
|
||||||
|
#[deriving(Eq)]
|
||||||
struct Bar(int, int);
|
struct Bar(int, int);
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let f: extern fn(int) -> Foo = Foo;
|
let f: extern fn(int) -> Foo = Foo;
|
||||||
let g: extern fn(int, int) -> Bar = Bar;
|
let g: extern fn(int, int) -> Bar = Bar;
|
||||||
f(42);
|
assert_eq!(f(42), Foo(42));
|
||||||
g(4, 7);
|
assert_eq!(g(4, 7), Bar(4, 7));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user