diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-11-21 15:53:49 -0500 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-11-29 12:09:11 -0800 |
| commit | e7f07cb2a377628922b337fdd08ca2dbbb14f2a5 (patch) | |
| tree | 1e34a509b40f360a31fdecdcb0f5fd1133f691b1 /src | |
| parent | 45bcb10204b3e2e04521a895c3f4216b5eb641ce (diff) | |
| download | rust-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.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/macro-interpolation.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/macro-path.rs | 12 | ||||
| -rw-r--r-- | src/test/run-pass/pipe-presentation-examples.rs | 4 |
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 |
