rust/src/test/run-pass/expr-if-fail.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

14 lines
349 B
Rust

fn test_if_fail() { let x = if false { fail } else { 10 }; assert (x == 10); }
fn test_else_fail() {
let x = if true { 10 } else { fail };
assert (x == 10);
}
fn test_elseif_fail() {
let x = if false { 0 } else if false { fail } else { 10 };
assert (x == 10);
}
fn main() { test_if_fail(); test_else_fail(); test_elseif_fail(); }