diff options
author | David Mitchell <davem@iabyn.com> | 2012-06-06 17:16:19 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-06-13 13:32:57 +0100 |
commit | ec841a2713df373c7218f3a42db1c4cfd1a58ed7 (patch) | |
tree | 0aeced93c0c821992e520f97c9cf0863d2b635d7 /ext/re | |
parent | 41953474e1ef403e3890fdf87368595ac0a92cb8 (diff) | |
download | perl-ec841a2713df373c7218f3a42db1c4cfd1a58ed7.tar.gz |
propagate /msix and (?msix) etc flags into (??{})
In /.........(??{ some_string_value; }).../flags
and /(?flags).(??{ some_string_value; }).../,
use flags when compiling the inner /some_string_value/ pattern.
Achieve this by storing the compile-time modifier flags in the
(apparently) unused 'flags' field of the EVAL node in the (??{})
case.
Diffstat (limited to 'ext/re')
-rw-r--r-- | ext/re/t/reflags.t | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/re/t/reflags.t b/ext/re/t/reflags.t index 56763fd333..b2cbf80d38 100644 --- a/ext/re/t/reflags.t +++ b/ext/re/t/reflags.t @@ -10,26 +10,35 @@ BEGIN { use strict; -use Test::More tests => 53; +use Test::More tests => 62; my @flags = qw( a d l u ); use re '/i'; ok "Foo" =~ /foo/, 'use re "/i"'; +ok "Foo" =~ /(??{'foo'})/, 'use re "/i" (??{})'; no re '/i'; ok "Foo" !~ /foo/, 'no re "/i"'; +ok "Foo" !~ /(??{'foo'})/, 'no re "/i" (??{})'; use re '/x'; ok "foo" =~ / foo /, 'use re "/x"'; +ok "foo" =~ / (??{' foo '}) /, 'use re "/x" (??{})'; no re '/x'; ok "foo" !~ / foo /, 'no re "/x"'; +ok "foo" !~ /(??{' foo '})/, 'no re "/x" (??{})'; +ok "foo" !~ / (??{'foo'}) /, 'no re "/x" (??{})'; use re '/s'; ok "\n" =~ /./, 'use re "/s"'; +ok "\n" =~ /(??{'.'})/, 'use re "/s" (??{})'; no re '/s'; ok "\n" !~ /./, 'no re "/s"'; +ok "\n" !~ /(??{'.'})/, 'no re "/s" (??{})'; use re '/m'; ok "\nfoo" =~ /^foo/, 'use re "/m"'; +ok "\nfoo" =~ /(??{'^'})foo/, 'use re "/m" (??{})'; no re '/m'; ok "\nfoo" !~ /^foo/, 'no re "/m"'; +ok "\nfoo" !~ /(??{'^'})foo/, 'no re "/m" (??{})'; use re '/xism'; ok qr// =~ /(?=.*x)(?=.*i)(?=.*s)(?=.*m)/, 'use re "/multiple"'; |