aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/expr-if-box.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-31 21:18:23 -0400
committerBrian Anderson <[email protected]>2011-03-31 23:15:11 -0400
commitbd1c61548ec2ddde4d85dbef88eed6627b536d13 (patch)
tree2199f2e3935df68d87122b34ea84ed6a3284422c /src/test/run-pass/expr-if-box.rs
parentAdd block_to_str and expr_to_str methods to the pprust module. (diff)
downloadrust-bd1c61548ec2ddde4d85dbef88eed6627b536d13.tar.xz
rust-bd1c61548ec2ddde4d85dbef88eed6627b536d13.zip
Move str test from expr-if.rs to expr-if-box.rs in preperation for breaking that code path.
Diffstat (limited to 'src/test/run-pass/expr-if-box.rs')
-rw-r--r--src/test/run-pass/expr-if-box.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/run-pass/expr-if-box.rs b/src/test/run-pass/expr-if-box.rs
index 98503211..30dce957 100644
--- a/src/test/run-pass/expr-if-box.rs
+++ b/src/test/run-pass/expr-if-box.rs
@@ -9,6 +9,12 @@ fn test_box() {
check (*res == 100);
}
+fn test_str() {
+ auto res = if (true) { "happy" } else { "sad" };
+ check (res == "happy");
+}
+
fn main() {
test_box();
-} \ No newline at end of file
+ test_str();
+}