rust/src/test/run-pass/lazy-and-or.rs

22 lines
274 B
Rust
Raw Normal View History

fn incr(& mutable int x) -> bool {
2010-06-23 23:03:09 -05:00
x += 1;
assert (false);
2010-06-23 23:03:09 -05:00
ret false;
}
fn main() {
auto x = (1 == 2) || (3 == 3);
assert (x);
2010-06-23 23:03:09 -05:00
let int y = 10;
log x || incr(y);
assert (y == 10);
2010-06-23 23:03:09 -05:00
if (true && x) {
assert (true);
2010-06-23 23:03:09 -05:00
} else {
assert (false);
2010-06-23 23:03:09 -05:00
}
}