File: regexpref.t

package info (click to toggle)
libtest-deep-perl 1.205-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 620 kB
  • sloc: perl: 2,413; makefile: 9
file content (32 lines) | stat: -rw-r--r-- 511 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
use strict;
use warnings;
use lib 't/lib';

use Std;
my $xism = qr/x/=~/\(\?\^/ ? "^" : "-xism";
{
  check_test(
    sub {
      cmp_deeply(qr/a/, qr/a/, "regexp ref eq");
    },
    {
      name => "regexp ref eq",
      actual_ok => 1,
      diag => "",
    }
  );
  check_test(
    sub {
      cmp_deeply(qr/a/, qr/b/, "regexp ref not eq");
    },
    {
      name => "regexp ref not eq",
      actual_ok => 0,
      diag => <<EOM,
Compared m/\$data/
   got : (?$xism:a)
expect : (?$xism:b)
EOM
    }
  );
}