about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAustin Seipp <as@hacks.yi.org>2012-01-09 19:15:17 -0600
committerBrian Anderson <banderson@mozilla.com>2012-01-09 19:27:05 -0800
commita94b1ccacbc2869b6a67afcda98d7495c0086eb3 (patch)
tree46c25968d972b54ef5acb86a7c18ed1bcf541f3e /src/test
parentaeae04cb49a3af321e75f839d409768014bd5169 (diff)
downloadrust-a94b1ccacbc2869b6a67afcda98d7495c0086eb3.tar.gz
rust-a94b1ccacbc2869b6a67afcda98d7495c0086eb3.zip
Change all uses of 'when' in alt-patterns to 'if'
Issue #1396
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/block-arg.rs2
-rw-r--r--src/test/run-pass/guards.rs6
-rw-r--r--src/test/run-pass/unreachable-code.rs2
-rw-r--r--src/test/stdtest/math.rs2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/test/run-pass/block-arg.rs b/src/test/run-pass/block-arg.rs
index ebbcc65d158..94e1973bbe7 100644
--- a/src/test/run-pass/block-arg.rs
+++ b/src/test/run-pass/block-arg.rs
@@ -29,7 +29,7 @@ fn main() {
         false { }
     }
     alt 3 {
-      _ when vec::any(v) { |e| float::is_negative(e) } {
+      _ if vec::any(v) { |e| float::is_negative(e) } {
       }
       _ {
         fail "wrong answer.";
diff --git a/src/test/run-pass/guards.rs b/src/test/run-pass/guards.rs
index 2da4a0296fd..2dc646ee823 100644
--- a/src/test/run-pass/guards.rs
+++ b/src/test/run-pass/guards.rs
@@ -1,12 +1,12 @@
 fn main() {
     let a =
-        alt 10 { x when x < 7 { 1 } x when x < 11 { 2 } 10 { 3 } _ { 4 } };
+        alt 10 { x if x < 7 { 1 } x if x < 11 { 2 } 10 { 3 } _ { 4 } };
     assert (a == 2);
 
     let b =
         alt {x: 10, y: 20} {
-          x when x.x < 5 && x.y < 5 { 1 }
-          {x: x, y: y} when x == 10 && y == 20 { 2 }
+          x if x.x < 5 && x.y < 5 { 1 }
+          {x: x, y: y} if x == 10 && y == 20 { 2 }
           {x: x, y: y} { 3 }
         };
     assert (b == 2);
diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs
index 2ccf2394bed..2570e598b08 100644
--- a/src/test/run-pass/unreachable-code.rs
+++ b/src/test/run-pass/unreachable-code.rs
@@ -31,7 +31,7 @@ fn ret_ret() -> int { ret (ret 2) + 3; }
 
 fn ret_guard() {
     alt 2 {
-      x when (ret) { x; }
+      x if (ret) { x; }
     }
 }
 
diff --git a/src/test/stdtest/math.rs b/src/test/stdtest/math.rs
index c8335718da9..adb68e4198c 100644
--- a/src/test/stdtest/math.rs
+++ b/src/test/stdtest/math.rs
@@ -251,7 +251,7 @@ fn test_sqrt() {
 fn test_angle() {
     fn angle(vec: (float, float)) -> float {
         alt vec {
-          (0f, y) when y < 0f { 1.5 * consts::pi }
+          (0f, y) if y < 0f { 1.5 * consts::pi }
           (0f, y) { 0.5 * consts::pi }
           (x, y) { float::atan(y / x) }
         }