diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-02-10 06:24:32 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-02-11 11:38:42 -0500 |
| commit | d63df5f276234c4fe823ee223b2adec8875fddac (patch) | |
| tree | e5b72fd98f6535032fba79a0851945bb0c08d3af | |
| parent | 9e133d113ba45e146d091c699f5235052f798012 (diff) | |
| download | rust-d63df5f276234c4fe823ee223b2adec8875fddac.tar.gz rust-d63df5f276234c4fe823ee223b2adec8875fddac.zip | |
Tweak test name and make it more specific
| -rw-r--r-- | src/test/run-pass/cleanup-rvalue-during-if-and-while.rs (renamed from src/test/run-pass/temporary-lifetime-for-conditions.rs) | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/run-pass/temporary-lifetime-for-conditions.rs b/src/test/run-pass/cleanup-rvalue-during-if-and-while.rs index 0716ea5cdeb..1ae907065bf 100644 --- a/src/test/run-pass/temporary-lifetime-for-conditions.rs +++ b/src/test/run-pass/cleanup-rvalue-during-if-and-while.rs @@ -9,8 +9,8 @@ // except according to those terms. -// This test verifies that temporaries created for `while`'s -// and `if` conditions are correctly cleaned up. +// This test verifies that temporaries created for `while`'s and `if` +// conditions are dropped after the condition is evaluated. struct Temporary; @@ -37,6 +37,7 @@ pub fn main() { // `drop` 6 times. while borrow().do_stuff() { i += 1; + unsafe { assert_eq!(DROPPED, i) } if i > 5 { break; } @@ -45,6 +46,6 @@ pub fn main() { // This if condition should // call it 1 time if borrow().do_stuff() { - unsafe { assert_eq!(DROPPED, 7) } + unsafe { assert_eq!(DROPPED, i + 1) } } } |
