From 6855061c6131a8c9eb9e0fd6f49e02c3a0cfe2a9 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 22 Feb 2023 15:25:47 -0700 Subject: [PATCH] Split t/uni/variables.t into multiple tests These can be done in parallel; otherwise this is often the test that finishes last, holding up the test suite completion. --- MANIFEST | 25 +++++++++++++++++++++++++ t/uni/idstart.pl | 46 ++++++++++++++++++++++++++++++++++++++++++++++ t/uni/idstart00.t | 13 +++++++++++++ t/uni/idstart01.t | 13 +++++++++++++ t/uni/idstart02.t | 13 +++++++++++++ t/uni/idstart03.t | 13 +++++++++++++ t/uni/idstart04.t | 13 +++++++++++++ t/uni/idstart05.t | 13 +++++++++++++ t/uni/idstart06.t | 13 +++++++++++++ t/uni/idstart07.t | 13 +++++++++++++ t/uni/idstart08.t | 13 +++++++++++++ t/uni/idstart09.t | 13 +++++++++++++ t/uni/idstart10.t | 13 +++++++++++++ t/uni/idstart11.t | 13 +++++++++++++ t/uni/idstart12.t | 13 +++++++++++++ t/uni/idstart13.t | 13 +++++++++++++ t/uni/idstart14.t | 13 +++++++++++++ t/uni/idstart15.t | 13 +++++++++++++ t/uni/idstart16.t | 13 +++++++++++++ t/uni/idstart17.t | 13 +++++++++++++ t/uni/idstart18.t | 13 +++++++++++++ t/uni/idstart19.t | 13 +++++++++++++ t/uni/idstart20.t | 13 +++++++++++++ t/uni/idstart21.t | 13 +++++++++++++ t/uni/idstart22.t | 13 +++++++++++++ t/uni/idstart23.t | 13 +++++++++++++ t/uni/variables.t | 18 +----------------- 27 files changed, 384 insertions(+), 17 deletions(-) create mode 100644 t/uni/idstart.pl create mode 100644 t/uni/idstart00.t create mode 100644 t/uni/idstart01.t create mode 100644 t/uni/idstart02.t create mode 100644 t/uni/idstart03.t create mode 100644 t/uni/idstart04.t create mode 100644 t/uni/idstart05.t create mode 100644 t/uni/idstart06.t create mode 100644 t/uni/idstart07.t create mode 100644 t/uni/idstart08.t create mode 100644 t/uni/idstart09.t create mode 100644 t/uni/idstart10.t create mode 100644 t/uni/idstart11.t create mode 100644 t/uni/idstart12.t create mode 100644 t/uni/idstart13.t create mode 100644 t/uni/idstart14.t create mode 100644 t/uni/idstart15.t create mode 100644 t/uni/idstart16.t create mode 100644 t/uni/idstart17.t create mode 100644 t/uni/idstart18.t create mode 100644 t/uni/idstart19.t create mode 100644 t/uni/idstart20.t create mode 100644 t/uni/idstart21.t create mode 100644 t/uni/idstart22.t create mode 100644 t/uni/idstart23.t diff --git a/MANIFEST b/MANIFEST index db8179c93228..6906e06ebd02 100644 --- a/MANIFEST +++ b/MANIFEST @@ -6634,6 +6634,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 diff --git a/t/uni/idstart.pl b/t/uni/idstart.pl new file mode 100644 index 000000000000..bdb4068fafed --- /dev/null +++ b/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; \$$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", + ) + } +} diff --git a/t/uni/idstart00.t b/t/uni/idstart00.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart01.t b/t/uni/idstart01.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart02.t b/t/uni/idstart02.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart03.t b/t/uni/idstart03.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart04.t b/t/uni/idstart04.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart05.t b/t/uni/idstart05.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart06.t b/t/uni/idstart06.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart07.t b/t/uni/idstart07.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart08.t b/t/uni/idstart08.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart09.t b/t/uni/idstart09.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart10.t b/t/uni/idstart10.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart11.t b/t/uni/idstart11.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart12.t b/t/uni/idstart12.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart13.t b/t/uni/idstart13.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart14.t b/t/uni/idstart14.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart15.t b/t/uni/idstart15.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart16.t b/t/uni/idstart16.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart17.t b/t/uni/idstart17.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart18.t b/t/uni/idstart18.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart19.t b/t/uni/idstart19.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart20.t b/t/uni/idstart20.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart21.t b/t/uni/idstart21.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/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 diff --git a/t/uni/idstart22.t b/t/uni/idstart22.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/t/uni/idstart22.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 diff --git a/t/uni/idstart23.t b/t/uni/idstart23.t new file mode 100644 index 000000000000..bd5ddc88032a --- /dev/null +++ b/t/uni/idstart23.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 diff --git a/t/uni/variables.t b/t/uni/variables.t index 2c18951a1a26..76b4b37af114 100644 --- a/t/uni/variables.t +++ b/t/uni/variables.t @@ -14,7 +14,7 @@ use utf8; use open qw( :utf8 :std ); no warnings qw(misc reserved); -plan (tests => 66880); +plan (tests => 1600); # ${single:colon} should not be treated as a simple variable, but as a # block with a label inside. @@ -286,22 +286,6 @@ for my $chr ( ); } -for my $i (0x100..0xffff) { - my $chr = chr($i); - my $esc = sprintf("%x", $i); - local $@; - eval "my \$$chr = q; \$$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", - ) - } -} - { # Bleadperl v5.17.9-109-g3283393 breaks ZEFRAM/Module-Runtime-0.013.tar.gz # https://github.com/Perl/perl5/issues/12841