From efb738153c7248601a9a1b294b0ad8fd9c27023c Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 28 Mar 2011 00:46:16 -0400 Subject: [PATCH] Add an XFAILed test for treating alts as expressions --- src/test/run-pass/expr-alt.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/run-pass/expr-alt.rs diff --git a/src/test/run-pass/expr-alt.rs b/src/test/run-pass/expr-alt.rs new file mode 100644 index 00000000000..859c593850a --- /dev/null +++ b/src/test/run-pass/expr-alt.rs @@ -0,0 +1,31 @@ +// xfail-boot +// xfail-stage0 +// -*- rust -*- + +// Tests for using alt as an expression + +fn test() { + let bool res = alt (true) { + case (true) { + true + } + case (false) { + false + } + }; + check (res); + + res = alt(false) { + case (true) { + false + } + case (false) { + true + } + }; + check (res); +} + +fn main() { + test(); +} \ No newline at end of file