2011-07-27 07:19:39 -05:00
|
|
|
fn test_if_fail() { let x = if false { fail } else { 10 }; assert (x == 10); }
|
2011-05-21 13:07:44 -05:00
|
|
|
|
|
|
|
fn test_else_fail() {
|
2011-07-27 07:19:39 -05:00
|
|
|
let x = if true { 10 } else { fail };
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (x == 10);
|
2011-05-21 13:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_elseif_fail() {
|
2011-08-19 17:16:48 -05:00
|
|
|
let x = if false { 0 } else if false { fail } else { 10 };
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (x == 10);
|
2011-05-21 13:07:44 -05:00
|
|
|
}
|
|
|
|
|
2011-08-19 17:16:48 -05:00
|
|
|
fn main() { test_if_fail(); test_else_fail(); test_elseif_fail(); }
|