diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/else-if.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/else-if.rs b/src/test/ui/else-if.rs new file mode 100644 index 000000000..77d8d1abf --- /dev/null +++ b/src/test/ui/else-if.rs @@ -0,0 +1,20 @@ +// run-pass + +pub fn main() { + if 1 == 2 { + assert!((false)); + } else if 2 == 3 { + assert!((false)); + } else if 3 == 4 { assert!((false)); } else { assert!((true)); } + if 1 == 2 { assert!((false)); } else if 2 == 2 { assert!((true)); } + if 1 == 2 { + assert!((false)); + } else if 2 == 2 { + if 1 == 1 { + assert!((true)); + } else { if 2 == 1 { assert!((false)); } else { assert!((false)); } } + } + if 1 == 2 { + assert!((false)); + } else { if 1 == 2 { assert!((false)); } else { assert!((true)); } } +} |