rust/src/test/run-pass/if-check.rs

27 lines
271 B
Rust
Raw Normal View History

2011-06-15 18:23:17 -05:00
// xfail-stage0
pred even(uint x) -> bool {
if (x < 2) {
ret false;
}
else if (x == 2) {
ret true;
}
else {
ret even(x - 2);
}
}
fn foo(uint x) -> () {
if check(even(x)) {
2011-06-15 18:23:17 -05:00
log x;
}
else {
fail;
}
}
fn main() {
foo(2u);
}