From f9c334d56f8db2aca87857afb647d409a7af60eb Mon Sep 17 00:00:00 2001 From: jnthn Date: Wed, 11 Mar 2015 23:05:39 +0100 Subject: [PATCH] Tests for RT #122253. Replaces some bogus tests with incorrect expectations. --- S05-interpolation/regex-in-variable.t | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/S05-interpolation/regex-in-variable.t b/S05-interpolation/regex-in-variable.t index d0d8847f41..d532af3980 100644 --- a/S05-interpolation/regex-in-variable.t +++ b/S05-interpolation/regex-in-variable.t @@ -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