about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Stansifer <paul.stansifer@gmail.com>2012-11-21 15:53:49 -0500
committerGraydon Hoare <graydon@mozilla.com>2012-11-29 12:09:11 -0800
commite7f07cb2a377628922b337fdd08ca2dbbb14f2a5 (patch)
tree1e34a509b40f360a31fdecdcb0f5fd1133f691b1 /src
parent45bcb10204b3e2e04521a895c3f4216b5eb641ce (diff)
downloadrust-e7f07cb2a377628922b337fdd08ca2dbbb14f2a5.tar.gz
rust-e7f07cb2a377628922b337fdd08ca2dbbb14f2a5.zip
Update tests to respect the way that macros work now.
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/macro-2.rs4
-rw-r--r--src/test/run-pass/macro-interpolation.rs4
-rw-r--r--src/test/run-pass/macro-path.rs12
-rw-r--r--src/test/run-pass/pipe-presentation-examples.rs4
4 files changed, 11 insertions, 13 deletions
diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs
index 595583d2cef..f342f5db140 100644
--- a/src/test/run-pass/macro-2.rs
+++ b/src/test/run-pass/macro-2.rs
@@ -3,10 +3,10 @@
 fn main() {
 
     macro_rules! mylambda_tt(
-        ($x:ident, $body:expr) => {
+        ($x:ident, $body:expr) => ({
             fn f($x: int) -> int { return $body; };
             f
-        }
+        })
     )
 
     assert(mylambda_tt!(y, y * 2)(8) == 16)
diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs
index 6ee4ac87807..d5e5fe1b489 100644
--- a/src/test/run-pass/macro-interpolation.rs
+++ b/src/test/run-pass/macro-interpolation.rs
@@ -1,7 +1,7 @@
 
 macro_rules! overly_complicated (
     ($fnname:ident, $arg:ident, $ty:ty, $body:block, $val:expr, $pat:pat, $res:path) =>
-    {
+    ({
         fn $fnname($arg: $ty) -> Option<$ty> $body
         match $fnname($val) {
           Some($pat) => {
@@ -9,7 +9,7 @@ macro_rules! overly_complicated (
           }
           _ => { fail; }
         }
-    }
+    })
 
 )
 fn main() {
diff --git a/src/test/run-pass/macro-path.rs b/src/test/run-pass/macro-path.rs
index 6c5a944ee29..d54fef5c260 100644
--- a/src/test/run-pass/macro-path.rs
+++ b/src/test/run-pass/macro-path.rs
@@ -2,13 +2,11 @@ mod m {
     pub type t = int;
 }
 
-fn macros() {
-    macro_rules! foo {
-        ($p:path) => {
-            fn f() -> $p { 10 }
-            f()
-        }
-    }
+macro_rules! foo {
+    ($p:path) => ({
+        fn f() -> $p { 10 };
+        f()
+    })
 }
 
 fn main() {
diff --git a/src/test/run-pass/pipe-presentation-examples.rs b/src/test/run-pass/pipe-presentation-examples.rs
index e29eb9787c0..6b07f88a8a9 100644
--- a/src/test/run-pass/pipe-presentation-examples.rs
+++ b/src/test/run-pass/pipe-presentation-examples.rs
@@ -54,12 +54,12 @@ macro_rules! select (
             $($message:path$(($($x: ident),+))dont_type_this*
               -> $next:ident $e:expr),+
         } )+
-    } => {
+    } => ({
         let index = pipes::selecti([$(($port).header()),+]);
         select_if!(index, 0, $( $port => [
             $($message$(($($x),+))dont_type_this* -> $next $e),+
         ], )+)
-    }
+    })
 )
 
 // Types and protocols