Skip to content

Commit e7f07cb

Browse files
paulstansifergraydon
authored andcommitted
Update tests to respect the way that macros work now.
1 parent 45bcb10 commit e7f07cb

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

src/test/run-pass/macro-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
fn main() {
44

55
macro_rules! mylambda_tt(
6-
($x:ident, $body:expr) => {
6+
($x:ident, $body:expr) => ({
77
fn f($x: int) -> int { return $body; };
88
f
9-
}
9+
})
1010
)
1111

1212
assert(mylambda_tt!(y, y * 2)(8) == 16)

src/test/run-pass/macro-interpolation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
macro_rules! overly_complicated (
33
($fnname:ident, $arg:ident, $ty:ty, $body:block, $val:expr, $pat:pat, $res:path) =>
4-
{
4+
({
55
fn $fnname($arg: $ty) -> Option<$ty> $body
66
match $fnname($val) {
77
Some($pat) => {
88
$res
99
}
1010
_ => { fail; }
1111
}
12-
}
12+
})
1313

1414
)
1515
fn main() {

src/test/run-pass/macro-path.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ mod m {
22
pub type t = int;
33
}
44

5-
fn macros() {
6-
macro_rules! foo {
7-
($p:path) => {
8-
fn f() -> $p { 10 }
9-
f()
10-
}
11-
}
5+
macro_rules! foo {
6+
($p:path) => ({
7+
fn f() -> $p { 10 };
8+
f()
9+
})
1210
}
1311

1412
fn main() {

src/test/run-pass/pipe-presentation-examples.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ macro_rules! select (
5454
$($message:path$(($($x: ident),+))dont_type_this*
5555
-> $next:ident $e:expr),+
5656
} )+
57-
} => {
57+
} => ({
5858
let index = pipes::selecti([$(($port).header()),+]);
5959
select_if!(index, 0, $( $port => [
6060
$($message$(($($x),+))dont_type_this* -> $next $e),+
6161
], )+)
62-
}
62+
})
6363
)
6464

6565
// Types and protocols

0 commit comments

Comments
 (0)