From 413d97f8bdc1b14aea816eecd755ae278c5f508d Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 7 Nov 2011 12:19:50 -0800 Subject: [PATCH] Add tests for blocks that must not have results --- src/test/compile-fail/block-must-not-have-result-do.rs | 7 +++++++ src/test/compile-fail/block-must-not-have-result-for.rs | 7 +++++++ src/test/compile-fail/block-must-not-have-result-res.rs | 8 ++++++++ src/test/compile-fail/block-must-not-have-result-while.rs | 7 +++++++ 4 files changed, 29 insertions(+) create mode 100644 src/test/compile-fail/block-must-not-have-result-do.rs create mode 100644 src/test/compile-fail/block-must-not-have-result-for.rs create mode 100644 src/test/compile-fail/block-must-not-have-result-res.rs create mode 100644 src/test/compile-fail/block-must-not-have-result-while.rs diff --git a/src/test/compile-fail/block-must-not-have-result-do.rs b/src/test/compile-fail/block-must-not-have-result-do.rs new file mode 100644 index 00000000000..7a1a384e64b --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-do.rs @@ -0,0 +1,7 @@ +// error-pattern:this block must not have a result + +fn main() { + do { + true + } while true; +} \ No newline at end of file diff --git a/src/test/compile-fail/block-must-not-have-result-for.rs b/src/test/compile-fail/block-must-not-have-result-for.rs new file mode 100644 index 00000000000..5b5e1fafca2 --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-for.rs @@ -0,0 +1,7 @@ +// error-pattern:this block must not have a result + +fn main() { + for i in [0] { + true + } +} \ No newline at end of file diff --git a/src/test/compile-fail/block-must-not-have-result-res.rs b/src/test/compile-fail/block-must-not-have-result-res.rs new file mode 100644 index 00000000000..4e0a1a54232 --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-res.rs @@ -0,0 +1,8 @@ +// error-pattern:this block must not have a result + +resource r(i: int) { + true +} + +fn main() { +} \ No newline at end of file diff --git a/src/test/compile-fail/block-must-not-have-result-while.rs b/src/test/compile-fail/block-must-not-have-result-while.rs new file mode 100644 index 00000000000..d0417fc27ec --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-while.rs @@ -0,0 +1,7 @@ +// error-pattern:this block must not have a result + +fn main() { + while true { + true + } +} \ No newline at end of file