diff options
author | Karl Williamson <khw@cpan.org> | 2015-02-04 11:39:32 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-02-04 12:22:08 -0700 |
commit | 5e3921fba1b330ae984b7e20387e886de1057c05 (patch) | |
tree | a90ab7fa66d7a8112a44c225c54e197167d38af5 /ext/re | |
parent | 0e1658289f9097483ef0df19536b15fbc6a92511 (diff) | |
download | perl-5e3921fba1b330ae984b7e20387e886de1057c05.tar.gz |
ext/re/t/re.t: Use variable instead of constants
There are multiple occurrences of these constants in the file. It's
better to use a variable than to repeat them.
Diffstat (limited to 'ext/re')
-rw-r--r-- | ext/re/t/re.t | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/re/t/re.t b/ext/re/t/re.t index 13498bbe2d..353ff812d4 100644 --- a/ext/re/t/re.t +++ b/ext/re/t/re.t @@ -10,6 +10,9 @@ BEGIN { use strict; +my $re_taint_bit = 0x00100000; +my $re_eval_bit = 0x00200000; + use Test::More tests => 15; require_ok( 're' ); @@ -42,20 +45,20 @@ isnt( $ENV{PERL_RE_COLORS}, '', re::bits(0, 'nosuchsubpragma'); like( $warn, qr/Unknown "re" subpragma/, '... should warn about unknown subpragma' ); -ok( re::bits(0, 'taint') & 0x00100000, '... should set taint bits' ); -ok( re::bits(0, 'eval') & 0x00200000, '... should set eval bits' ); +ok( re::bits(0, 'taint') & $re_taint_bit, '... should set taint bits' ); +ok( re::bits(0, 'eval') & $re_eval_bit, '... should set eval bits' ); local $^H; # import re->import('taint', 'eval'); -ok( $^H & 0x00100000, 'import should set taint bits in $^H when requested' ); -ok( $^H & 0x00200000, 'import should set eval bits in $^H when requested' ); +ok( $^H & $re_taint_bit, 'import should set taint bits in $^H when requested' ); +ok( $^H & $re_eval_bit, 'import should set eval bits in $^H when requested' ); re->unimport('taint'); -ok( !( $^H & 0x00100000 ), 'unimport should clear bits in $^H when requested' ); +ok( !( $^H & $re_taint_bit ), 'unimport should clear bits in $^H when requested' ); re->unimport('eval'); -ok( !( $^H & 0x00200000 ), '... and again' ); +ok( !( $^H & $re_eval_bit ), '... and again' ); my $reg=qr/(foo|bar|baz|blah)/; close STDERR; eval"use re Debug=>'ALL'"; |