@@ -8,7 +8,7 @@ version 0.3 (12 Apr 2004), file t/patvar.t.
8
8
9
9
= end pod
10
10
11
- plan 54 ;
11
+ plan 52 ;
12
12
13
13
# L<S05/Variable (non-)interpolation>
14
14
@@ -39,39 +39,40 @@ ok("aaaaab" ~~ m/<$foo>/, 'Rulish scalar match 5');
39
39
ok (! (" aaaaab" ~~ m /$ foo /), ' Rulish scalar match 6' );
40
40
ok (! (' aaaaab' ~~ m /"$foo" /), ' Rulish scalar match 7' );
41
41
42
- # RT #61960
43
42
{
44
- my $ a = ' a' ;
45
- ok ' a' ~~ / $ a /, ' match with string as rx works' ;
43
+ no MONKEY-SEE-NO-EVAL ;
44
+ # RT #61960
45
+ {
46
+ my $ a = ' a' ;
47
+ ok ' a' ~~ / $ a /, ' match with string as rx works' ;
48
+ }
49
+
50
+ # RT #100232
51
+ throws-like { my $ x = ' 1} if say "pwnd"; #' ; ' a' ~~ /<$x > / }, X::SecurityPolicy , " particular garbage-in recognized as being garbage (see RT)" ;
52
+
53
+ # because it broke these:
54
+ {
55
+ ok " foo" ~~ /<{' o ** 2 ' }> /, ' returns true' ;
56
+ isa-ok " foo" ~~ /<{' o ** 2 ' }> /, Match , ' returns a valid Match' ;
57
+ is ~ (" foo" ~~ /<{' o ** 2 ' }> /), " oo" , ' returns correct Match' ;
58
+ }
59
+
60
+ throws-like { ' a' ~~ /<{'$(say "trivially pwned")' }> / }, X::SecurityPolicy , " should handle this too" ;
61
+ throws-like { ' a' ~~ /<{' "{say q/pwnzered/}" ' }> / }, X::SecurityPolicy , " should handle this too" ;
62
+ throws-like { ' a' ~~ /<{' "foo $_ bar " ' }> / }, X::SecurityPolicy , " should handle this too" ;
63
+ throws-like { ' a' ~~ /<{' "foo @*ARGS[] bar " ' }> / }, X::SecurityPolicy , " should handle this too" ;
64
+ throws-like { ' a' ~~ /<{' "foo %*ENV{} bar " ' }> / }, X::SecurityPolicy , " should handle this too" ;
65
+ throws-like { ' a' ~~ /<{' "foo &infix:<+>() " ' }> / }, X::SecurityPolicy , " should handle this too" ;
66
+ throws-like { ' a' ~~ /<{' :my $x = {say q/hi!/}; ' }> / }, X::SecurityPolicy , " should handle this too" ;
67
+ throws-like { ' a' ~~ /<{' {say q/gotcha/} ' }> / }, X::SecurityPolicy , " should handle this too" ;
68
+ throws-like { ' a' ~~ /<{' <{say q/gotcha/}> ' }> / }, X::SecurityPolicy , " should handle this too" ;
69
+ throws-like { ' a' ~~ /<{' <?{say q/gotcha/}> ' }> / }, X::SecurityPolicy , " should handle this too" ;
70
+ throws-like { ' a' ~~ /<{' <!{say q/gotcha/}> ' }> / }, X::SecurityPolicy , " should handle this too" ;
71
+ throws-like { ' a' ~~ /<{' <foo=!{say q/gotcha/}> ' }> / }, X::SecurityPolicy , " should handle this too" ;
72
+ throws-like { ' a' ~~ /<{' <alpha(say q/gotcha/)> ' }> / }, X::SecurityPolicy , " should handle this too" ;
73
+ throws-like { ' a' ~~ /<{' "$x:(say "busted")" ' }> / }, X::SecurityPolicy , " should handle this too" ;
46
74
}
47
75
48
- # RT #100232
49
- throws-like Q [ my $x = '1} if say "pwnd"; #'; 'a' ~~ /<$x>/ ] , Exception , " particular garbage-in recognized as being garbage (see RT)" ;
50
-
51
- # because it broke these:
52
- {
53
- ok " foo" ~~ /<{' o ** 2 ' }> /, ' returns true' ;
54
- isa-ok " foo" ~~ /<{' o ** 2 ' }> /, Match , ' returns a valid Match' ;
55
- is ~ (" foo" ~~ /<{' o ** 2 ' }> /), " oo" , ' returns correct Match' ;
56
- }
57
-
58
- throws-like Q [ 'a' ~~ /<{'$(say "trivially pwned")'}>/ ] , Exception , " should handle this too" ;
59
- throws-like Q [ 'a' ~~ /<{' "{say q/pwnzered/}" '}>/ ] , Exception , " should handle this too" ;
60
- throws-like Q [ 'a' ~~ /<{' "foo $_ bar " '}>/ ] , Exception , " should handle this too" ;
61
- throws-like Q [ 'a' ~~ /<{' "foo @*ARGS[] bar " '}>/ ] , Exception , " should handle this too" ;
62
- throws-like Q [ 'a' ~~ /<{' "foo %*ENV{} bar " '}>/ ] , Exception , " should handle this too" ;
63
- throws-like Q [ 'a' ~~ /<{' "foo &infix:<+>() " '}>/ ] , Exception , " should handle this too" ;
64
- throws-like Q [ 'a' ~~ /<{' :my $x = {say q/hi!/}; '}>/ ] , Exception , " should handle this too" ;
65
- throws-like Q [ 'a' ~~ /<{' {say q/gotcha/} '}>/ ] , Exception , " should handle this too" ;
66
- throws-like Q [ 'a' ~~ /<{' <{say q/gotcha/}> '}>/ ] , Exception , " should handle this too" ;
67
- throws-like Q [ 'a' ~~ /<{' <?{say q/gotcha/}> '}>/ ] , Exception , " should handle this too" ;
68
- throws-like Q [ 'a' ~~ /<{' <!{say q/gotcha/}> '}>/ ] , Exception , " should handle this too" ;
69
- throws-like Q [ 'a' ~~ /<{' <foo=!{say q/gotcha/}> '}>/ ] , Exception , " should handle this too" ;
70
- throws-like Q [ 'a' ~~ /<{' <alpha(say q/gotcha/)> '}> '}>/ ] , Exception , " should handle this too" ;
71
- throws-like Q [ 'a' ~~ /<{' $x:(say "busted") '}> '}>/ ] , Exception , " should handle this too" ;
72
- throws-like Q [ 'a' ~~ /<{' "$x:(say "busted")" '}> '}>/ ] , Exception , " should handle this too" ;
73
- throws-like Q [ 'a' ~~ /<{' q/\qq[{say "busted"}]/ '}> '}>/ ] , Exception , " should handle this too" ;
74
-
75
76
# Arrays
76
77
77
78
ok (" a" ~~ m /@ var /, ' Simple array match (a)' );
0 commit comments