Skip to content

Commit

Permalink
Split t/uni/variables.t into multiple tests
Browse files Browse the repository at this point in the history
These can be done in parallel; otherwise this is often the test that
finishes last, holding up the test suite completion.
  • Loading branch information
khwilliamson committed May 12, 2023
1 parent 19037fb commit 16114d1
Show file tree
Hide file tree
Showing 27 changed files with 384 additions and 17 deletions.
25 changes: 25 additions & 0 deletions MANIFEST
Expand Up @@ -6396,6 +6396,31 @@ t/uni/fold.t See if Unicode folding works
t/uni/goto.t See if Unicode goto &sub works
t/uni/greek.t See if Unicode in greek works
t/uni/gv.t See if Unicode GVs work.
t/uni/idstart.pl See if the rules for variable names work
t/uni/idstart00.t See if the rules for variable names work
t/uni/idstart01.t See if the rules for variable names work
t/uni/idstart02.t See if the rules for variable names work
t/uni/idstart03.t See if the rules for variable names work
t/uni/idstart04.t See if the rules for variable names work
t/uni/idstart05.t See if the rules for variable names work
t/uni/idstart06.t See if the rules for variable names work
t/uni/idstart07.t See if the rules for variable names work
t/uni/idstart08.t See if the rules for variable names work
t/uni/idstart09.t See if the rules for variable names work
t/uni/idstart10.t See if the rules for variable names work
t/uni/idstart11.t See if the rules for variable names work
t/uni/idstart12.t See if the rules for variable names work
t/uni/idstart13.t See if the rules for variable names work
t/uni/idstart14.t See if the rules for variable names work
t/uni/idstart15.t See if the rules for variable names work
t/uni/idstart16.t See if the rules for variable names work
t/uni/idstart17.t See if the rules for variable names work
t/uni/idstart18.t See if the rules for variable names work
t/uni/idstart19.t See if the rules for variable names work
t/uni/idstart20.t See if the rules for variable names work
t/uni/idstart21.t See if the rules for variable names work
t/uni/idstart22.t See if the rules for variable names work
t/uni/idstart23.t See if the rules for variable names work
t/uni/labels.t See if Unicode labels work
t/uni/latin2.t See if Unicode in latin2 works
t/uni/lex_utf8.t See if Unicode in lexer works
Expand Down
46 changes: 46 additions & 0 deletions t/uni/idstart.pl
@@ -0,0 +1,46 @@
#!./perl

use strict;
use warnings;

BEGIN {
chdir 't' if -d 't';
require './test.pl';
skip_all_without_unicode_tables();
}

use 5.016;
use utf8;
#use open qw( :utf8 :std );
#no warnings qw(misc reserved);

my $chunks = 24;
my $total_tests = 65280;
my $tests;
#print STDERR __FILE__, ": ", __LINE__, ": $chunks\n";

{
use integer;
$tests = $total_tests / $chunks;
$tests += $total_tests % $chunks if $::TESTCHUNK == $chunks - 1;
}
#print STDERR __FILE__, ": ", __LINE__, ": $tests\n";

plan (tests => $tests);

my $start = 0x100 + $::TESTCHUNK * $tests;
for my $i ($start .. $start + $tests - 1) {
my $chr = chr($i);
my $esc = sprintf("%x", $i);
local $@;
eval "my \$$chr = q<test>; \$$chr;";
if ( $chr =~ /^\p{_Perl_IDStart}$/ ) {
is($@, '', sprintf("\\x{%04x} is XIDS, works as a length-1 variable", $i));
}
else {
like($@,
qr/\QUnrecognized character \x{$esc};/,
"\\x{$esc} isn't XIDS, illegal as a length-1 variable",
)
}
}
13 changes: 13 additions & 0 deletions t/uni/idstart00.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart01.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart02.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart03.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart04.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart05.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart06.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart07.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart08.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart09.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart10.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart11.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart12.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart13.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart14.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart15.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart16.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart17.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart18.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart19.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart20.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1
13 changes: 13 additions & 0 deletions t/uni/idstart21.t
@@ -0,0 +1,13 @@
#!./perl

use strict;
use warnings;
no warnings 'once';

__FILE__ =~ m/ ( \d+ ) \. t $ /x;
$::TESTCHUNK = $1 + 0;
#print STDERR __FILE__, ": ", __LINE__, ": ", $::TESTCHUNK, "\n";
do './uni/idstart.pl';
#print STDERR __FILE__, ": ", __LINE__, ": ", $@, "\n";

1

0 comments on commit 16114d1

Please sign in to comment.