Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test for RT #115500, unfudge passing tests for rakudo.jvm
  • Loading branch information
usev6 committed Oct 21, 2014
1 parent 20b3ee2 commit bab9270
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions S06-macros/quasi-blocks.t
@@ -1,12 +1,11 @@
use v6;

use Test;
plan 12;
plan 14;

# Just to avoid tedium, the macros in this file are
# named after Santa's reindeers.

#?rakudo.jvm skip "?"
{ # macro called like a sub
my $macro_visits;

Expand All @@ -31,7 +30,6 @@ plan 12;
dancer(15, 10);
}

#?rakudo.jvm skip "?"
{ # macro called like a list prefix
my $macro_visits;

Expand All @@ -58,7 +56,6 @@ plan 12;

# macro defined as an operator, and used as one

#?rakudo.jvm skip "?"
{
macro infix:<comet>($rhs, $lhs) { #OK not used
quasi { "comet!" }
Expand All @@ -68,7 +65,6 @@ plan 12;
is $result, "comet!", "can define an entirely new operator";
}

#?rakudo.jvm skip "?"
{
macro infix:<+>($rhs, $lhs) {
quasi { "chickpeas" }
Expand All @@ -78,7 +74,6 @@ plan 12;
is $result, "chickpeas", "can shadow an existing operator";
}

#?rakudo.jvm skip "?"
{
macro cupid {
my $a = "I'm cupid!";
Expand All @@ -103,7 +98,6 @@ plan 12;
is donner, 2, "...twice";
}

#?rakudo.jvm skip "?"
{
macro blitzen($param) {
quasi { $param }
Expand All @@ -113,7 +107,6 @@ plan 12;
"lexical lookup from quasi to macro params works";
}

#?rakudo.jvm skip "?"
{
macro id($param) { $param };
is id('x'), 'x', 'macro can return its param';
Expand All @@ -124,3 +117,22 @@ plan 12;
macro funny_nil { quasi { {;}() } }
is funny_nil(), Nil, 'Nil from an empty block turns into no code';
}

# RT #115500
#?rakudo.parrot 2 skip 'RT #115500'
{
macro rt115500v1() {
my $q1 = quasi { 6 };
my $q2 = quasi { 6 * 10 };
quasi { {{{$q1}}} + {{{$q2}}} }
};
is rt115500v1(), 66,
'addition of two quasis with arithmetical expressions works (1)';
macro rt115500v2() {
my $q1 = quasi { 5 + 1 };
my $q2 = quasi { 6 * 10 };
quasi { {{{$q1}}} + {{{$q2}}} }
};
is rt115500v2(), 66,
'addition of two quasis with arithmetical expressions works (2)';
}

0 comments on commit bab9270

Please sign in to comment.