xref: /openbsd-src/gnu/usr.bin/perl/ext/re/t/intflags.t (revision f2a19305cfc49ea4d1a5feb55cd6c283c6f1e031)
1*f2a19305Safresh1#!./perl
2*f2a19305Safresh1
3*f2a19305Safresh1BEGIN {
4*f2a19305Safresh1    require Config;
5*f2a19305Safresh1    if (($Config::Config{'extensions'} !~ /\bre\b/) ){
6*f2a19305Safresh1	print "1..0 # Skip -- Perl configured without re module\n";
7*f2a19305Safresh1	exit 0;
8*f2a19305Safresh1    }
9*f2a19305Safresh1}
10*f2a19305Safresh1
11*f2a19305Safresh1use strict;
12*f2a19305Safresh1
13*f2a19305Safresh1# must use a BEGIN or the prototypes wont be respected meaning
14*f2a19305Safresh1# tests could pass that shouldn't.
15*f2a19305Safresh1BEGIN { require "../../t/test.pl"; }
16*f2a19305Safresh1my $out = runperl(progfile => "t/intflags.pl", stderr => 1 );
17*f2a19305Safresh1like($out,qr/-OK-\n/, "intflags.pl ran to completion");
18*f2a19305Safresh1
19*f2a19305Safresh1my %seen;
20*f2a19305Safresh1foreach my $line (split /\n/, $out) {
21*f2a19305Safresh1    $line=~s/^r->intflags:\s+// or next;
22*f2a19305Safresh1    length($_) and $seen{$_}++ for split /\s+/, $line;
23*f2a19305Safresh1}
24*f2a19305Safresh1is(0+keys %seen,14);
25*f2a19305Safresh1done_testing;
26