This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Patch unit tests to explicitly insert "." into @INC when needed.
[perl5.git] / t / lib / Cname.pm
CommitLineData
fc8cd66c
YO
1package Cname;
2our $Evil='A';
3
4sub translator {
5 my $str = shift;
6 if ( $str eq 'EVIL' ) {
ff3f963a 7 # Returns A first time, AB second, ABC third ... A-ZA the 27th time.
fc8cd66c
YO
8 (my $c=substr("A".$Evil,-1))++;
9 my $r=$Evil;
10 $Evil.=$c;
11 return $r;
12 }
13 if ( $str eq 'EMPTY-STR') {
14 return "";
15 }
ff3f963a
KW
16 if ( $str eq 'NULL') {
17 return "\0";
18 }
19 if ( $str eq 'LONG-STR') {
20 return 'A' x 255;
21 }
22 # Should exceed limit for regex \N bytes in a sequence. Anyway it will if
23 # UCHAR_MAX is 255.
24 if ( $str eq 'TOO-LONG-STR') {
25 return 'A' x 256;
26 }
fc8cd66c
YO
27 return $str;
28}
29
30sub import {
31 shift;
32 $^H{charnames} = \&translator;
33}
341;