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