Skip to content

Commit

Permalink
Update tests to respect the way that macros work now.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstansifer authored and graydon committed Nov 29, 2012
1 parent 45bcb10 commit e7f07cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/test/run-pass/macro-2.rs
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/macro-interpolation.rs
@@ -1,15 +1,15 @@

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) => {
$res
}
_ => { fail; }
}
}
})

)
fn main() {
Expand Down
12 changes: 5 additions & 7 deletions src/test/run-pass/macro-path.rs
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/pipe-presentation-examples.rs
Expand Up @@ -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
Expand Down

0 comments on commit e7f07cb

Please sign in to comment.