diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-03-29 14:03:35 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-03-29 14:03:35 +0000 |
commit | 48e3bbddf569369fe6921f305df6ab7290c91152 (patch) | |
tree | 27581551622c277b9b57193a2561f4f95b911736 /t/op | |
parent | bbf10c2aaed41703b878ff1b4186877d4ac3ba9a (diff) | |
download | perl-48e3bbddf569369fe6921f305df6ab7290c91152.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@15597
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/attrs.t | 8 | ||||
-rwxr-xr-x | t/op/pat.t | 31 |
2 files changed, 36 insertions, 3 deletions
diff --git a/t/op/attrs.t b/t/op/attrs.t index 8e04936f8d..1ed92a1a8d 100644 --- a/t/op/attrs.t +++ b/t/op/attrs.t @@ -180,6 +180,14 @@ eval 'package A; sub X { $_[0] } sub X : lvalue'; mytest '', "@attrs", "lvalue"; BEGIN {++$ntests} +# Above not with just 'pure' built-in attributes. +sub Z::MODIFY_CODE_ATTRIBUTES { (); } +eval 'package Z; sub L { $_[0] } sub L : Z lvalue'; +@attrs = eval 'attributes::get \&Z::L'; +mytest '', "@attrs", "lvalue Z"; +BEGIN {++$ntests} + + # Begin testing attributes that tie { diff --git a/t/op/pat.t b/t/op/pat.t index 001a5b0ac5..82749a077a 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..903\n"; +print "1..908\n"; BEGIN { chdir 't' if -d 't'; @@ -2774,12 +2774,11 @@ print "# some Unicode properties\n"; { - my $test = 893; - print "# Unicode hash keys and \\w\n"; # This is not really a regex test but regexes bring # out the issue nicely. use strict; + my $test = 893; my $u3 = "f\x{df}\x{100}"; my $u2 = substr($u3,0,2); my $u1 = substr($u2,0,1); @@ -2804,3 +2803,29 @@ print "# some Unicode properties\n"; } } +{ + print "# qr/.../x\n"; + my $test = 904; + + my $R = qr/ A B C # D E/x; + + print eval {"ABCDE" =~ $R} ? "ok $test\n" : "not ok $test\n"; + $test++; + + print eval {"ABCDE" =~ m/$R/} ? "ok $test\n" : "not ok $test\n"; + $test++; + + print eval {"ABCDE" =~ m/($R)/} ? "ok $test\n" : "not ok $test\n"; + $test++; +} + +{ + print "# illegal Unicode properties\n"; + my $test = 907; + + print eval { "a" =~ /\pq / } ? "not ok $test\n" : "ok $test\n"; + $test++; + + print eval { "a" =~ /\p{qrst} / } ? "not ok $test\n" : "ok $test\n"; + $test++; +} |