This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5db: remove leading ampersand.
[perl5.git] / ext / re / t / lexical_debug.t
1 #!./perl
2
3 BEGIN {
4     require Config;
5     if (($Config::Config{'extensions'} !~ /\bre\b/) ){
6         print "1..0 # Skip -- Perl configured without re module\n";
7         exit 0;
8     }
9 }
10
11 use strict;
12
13 # must use a BEGIN or the prototypes wont be respected meaning 
14     # tests could pass that shouldn't
15 BEGIN { require "../../t/test.pl"; }
16 my $out = runperl(progfile => "t/lexical_debug.pl", stderr => 1 );
17
18 print "1..10\n";
19
20 # Each pattern will produce an EXACT node with a specific string in 
21 # it, so we will look for that. We can't just look for the string
22 # alone as the string being matched against contains all of them.
23
24 ok( $out =~ /EXACT <foo>/, "Expect 'foo'"    );
25 ok( $out !~ /EXACT <bar>/, "No 'bar'"        );
26 ok( $out =~ /EXACT <baz>/, "Expect 'baz'"    );
27 ok( $out !~ /EXACT <bop>/, "No 'bop'"        );
28 ok( $out =~ /EXACT <fip>/, "Expect 'fip'"    );
29 ok( $out !~ /EXACT <fop>/, "No 'baz'"        );
30 ok( $out =~ /<liz>/,       "Got 'liz'"       ); # in a TRIE so no EXACT
31 ok( $out =~ /<zoo>/,       "Got 'zoo'"       ); # in a TRIE so no EXACT
32 ok( $out =~ /<zap>/,       "Got 'zap'"       ); # in a TRIE so no EXACT
33 ok( $out =~ /Count=7\n/,   "Count is 7") 
34     or diag($out);
35