1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
# 10_perl514.t
#
# Test suite for Regexp::Assemble
# Exercise regular expressions beyond perl 5.12
#
# copyright (C) 2011 David Landgren
use strict;
use Test::More;
if ($] < 5.013) {
plan skip_all => 'Irrelevant below perl <= 5.12';
}
else {
plan tests => 3;
}
use Regexp::Assemble;
my $fixed = 'The scalar remains the same';
$_ = $fixed;
{
my $r = Regexp::Assemble->new->debug(8)->add(qw(this that));
my $re = $r->re;
is( $re, '(?^:th(?:at|is))', 'time debug' );
}
{
my $r = Regexp::Assemble->new->add(qw(this that))->debug(8)->add('those');
my $re = $r->re;
is( $re, '(?^:th(?:ose|at|is))', 'deferred time debug' );
}
is( $_, $fixed, '$_ has not been altered' );
|