File: 10_perl514.t

package info (click to toggle)
libregexp-assemble-perl 0.38-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 608 kB
  • sloc: perl: 2,272; makefile: 8
file content (37 lines) | stat: -rw-r--r-- 706 bytes parent folder | download | duplicates (5)
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' );