Skip to content

Commit

Permalink
Tests for RT #122253.
Browse files Browse the repository at this point in the history
Replaces some bogus tests with incorrect expectations.
  • Loading branch information
jnthn committed Mar 11, 2015
1 parent b80e436 commit f9c334d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions S05-interpolation/regex-in-variable.t
Expand Up @@ -91,20 +91,18 @@ eval_dies_ok 'm/%var/', 'cannot interpolate hashes into regexes';
);
}

# RT #122253
#?niecza skip "Representation P6cursor does not support attributes"
{
my class InterpolationTest {
has $!pattern = 'a+b';

method run {
#?rakudo 2 todo 'instance member interpolation'
ok('aaab' ~~ / $!pattern /, 'Interpolation of instance member');
ok('aaab' ~~ / <$!pattern> /, 'Interpolation of instance member');
ok('aaab' ~~ / "$!pattern" /, 'Interpolation of instance member');
}
}

InterpolationTest.new.run;
throws_like { EVAL 'my class InterpolationTest { has $!a; method m() { /$!a/ } }' },
X::Attribute::Regex, :symbol<$!a>,
'Cannot interpolate attribute in a regex';
throws_like { EVAL 'my class InterpolationTest { has $!b; method m() { /<$!b>/ } }' },
X::Attribute::Regex, :symbol<$!b>,
'Cannot interpolate attribute in a regex in angle construct';
throws_like { EVAL 'my class InterpolationTest { has $!c; method m() { /<?> { $!c }/ } }' },
X::Attribute::Regex, :symbol<$!c>,
'Cannot interpolate attribute in a closure in a regex';
}

# vim: ft=perl6

0 comments on commit f9c334d

Please sign in to comment.