Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update exotic names test to avoid single quote package separator #128

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions t/exotic_names.t
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,32 @@ sub caller3_ok {

use Sub::Util 'set_subname';

my @ordinal = ( 1 .. 255 );

# 5.14 is the first perl to start properly handling \0 in identifiers
unshift @ordinal, 0
unless $] < 5.014;

# Unicode in 5.6 is not sane (crashes etc)
push @ordinal,
0x100, # LATIN CAPITAL LETTER A WITH MACRON
0x498, # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
0x2122, # TRADE MARK SIGN
0x1f4a9, # PILE OF POO
unless $] < 5.008;
my @ordinal = (
# 5.14 is the first perl to start properly handling \0 in identifiers
($] >= 5.014 ? ( 0 ) : ()),
1 .. 38,
# single quote ' separators are deprecated in 5.37.9
($] < 5.037009 ? ( 39 ) : ()),
40 .. 255,
# Unicode in 5.6 is not sane (crashes etc)
($] >= 5.008 ? (
0x100, # LATIN CAPITAL LETTER A WITH MACRON
0x498, # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
0x2122, # TRADE MARK SIGN
0x1f4a9, # PILE OF POO
) : ()),
);

my $legal_ident_char = join('',
"A-Z_a-z0-9",
($] < 5.037009 ? q['] : ()),
($] > 5.008 ? (
map chr, 0x100, 0x498
) : ()),
);

plan tests => @ordinal * 2 * 3;

my $legal_ident_char = "A-Z_a-z0-9'";
$legal_ident_char .= join '', map chr, 0x100, 0x498
unless $] < 5.008;

my $uniq = 'A000';
for my $ord (@ordinal) {
my $sub;
Expand Down
Loading