This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge branch 'blead' of ssh://perl5.git.perl.org/gitroot/perl into blead
[perl5.git] / dist / B-Deparse / t / deparse.t
CommitLineData
87a42246
MS
1#!./perl
2
3BEGIN {
62a6bb71 4 unshift @INC, 't';
9cd8f857
NC
5 require Config;
6 if (($Config::Config{'extensions'} !~ /\bB\b/) ){
7 print "1..0 # Skip -- Perl configured without B module\n";
8 exit 0;
9 }
87a42246
MS
10}
11
87a42246
MS
12use warnings;
13use strict;
e9c69003 14BEGIN {
c4a6f826 15 # BEGIN block is actually a subroutine :-)
e9c69003
NC
16 return unless $] > 5.009;
17 require feature;
18 feature->import(':5.10');
19}
507a68aa 20use Test::More;
1bb3cfc5 21use Config ();
87a42246
MS
22
23use B::Deparse;
09d856fb 24my $deparse = B::Deparse->new();
507a68aa 25isa_ok($deparse, 'B::Deparse', 'instantiate a B::Deparse object');
87a42246
MS
26
27# Tell B::Deparse about our ambient pragmas
0ced6c29
RGS
28{ my ($hint_bits, $warning_bits, $hinthash);
29 BEGIN { ($hint_bits, $warning_bits, $hinthash) = ($^H, ${^WARNING_BITS}, \%^H); }
87a42246
MS
30 $deparse->ambient_pragmas (
31 hint_bits => $hint_bits,
32 warning_bits => $warning_bits,
0ced6c29
RGS
33 '$[' => 0 + $[,
34 '%^H' => $hinthash,
87a42246
MS
35 );
36}
37
ad46c0be
RH
38$/ = "\n####\n";
39while (<DATA>) {
40 chomp;
e9c69003
NC
41 # This code is pinched from the t/lib/common.pl for TODO.
42 # It's not clear how to avoid duplication
b871937f
NC
43 # Now tweaked a bit to do skip or todo
44 my %reason;
45 foreach my $what (qw(skip todo)) {
46 s/^#\s*\U$what\E\s*(.*)\n//m and $reason{$what} = $1;
47 # If the SKIP reason starts ? then it's taken as a code snippet to
48 # evaluate. This provides the flexibility to have conditional SKIPs
49 if ($reason{$what} && $reason{$what} =~ s/^\?//) {
50 my $temp = eval $reason{$what};
51 if ($@) {
52 die "# In \U$what\E code reason:\n# $reason{$what}\n$@";
53 }
54 $reason{$what} = $temp;
e9c69003 55 }
e9c69003
NC
56 }
57
4a4b8592 58 s/^\s*#\s*(.*)$//mg;
507a68aa
NC
59 my $desc = $1;
60 die "Missing name in test $_" unless defined $desc;
e9c69003 61
b871937f 62 if ($reason{skip}) {
e9c69003 63 # Like this to avoid needing a label SKIP:
b871937f 64 Test::More->builder->skip($reason{skip});
e9c69003
NC
65 next;
66 }
67
ad46c0be
RH
68 my ($input, $expected);
69 if (/(.*)\n>>>>\n(.*)/s) {
70 ($input, $expected) = ($1, $2);
71 }
72 else {
73 ($input, $expected) = ($_, $_);
74 }
87a42246 75
ad46c0be 76 my $coderef = eval "sub {$input}";
87a42246 77
ad46c0be 78 if ($@) {
507a68aa 79 is($@, "", "compilation of $desc");
ad46c0be
RH
80 }
81 else {
82 my $deparsed = $deparse->coderef2text( $coderef );
31c6271a
RD
83 my $regex = $expected;
84 $regex =~ s/(\S+)/\Q$1/g;
85 $regex =~ s/\s+/\\s+/g;
86 $regex = '^\{\s*' . $regex . '\s*\}$';
b871937f 87
4a4b8592 88 local $::TODO = $reason{todo};
507a68aa 89 like($deparsed, qr/$regex/, $desc);
87a42246 90 }
87a42246
MS
91}
92
87a42246 93use constant 'c', 'stuff';
507a68aa
NC
94is((eval "sub ".$deparse->coderef2text(\&c))->(), 'stuff',
95 'the subroutine generated by use constant deparses');
87a42246 96
09d856fb 97my $a = 0;
507a68aa
NC
98is($deparse->coderef2text(sub{(-1) ** $a }), "{\n (-1) ** \$a;\n}",
99 'anon sub capturing an external lexical');
87a42246 100
d989cdac
SM
101use constant cr => ['hello'];
102my $string = "sub " . $deparse->coderef2text(\&cr);
0707d6cc 103my $val = (eval $string)->() or diag $string;
507a68aa
NC
104is(ref($val), 'ARRAY', 'constant array references deparse');
105is($val->[0], 'hello', 'and return the correct value');
87a42246 106
87a42246 107my $path = join " ", map { qq["-I$_"] } @INC;
87a42246 108
7cde0a5f 109$a = `$^X $path "-MO=Deparse" -anlwi.bak -e 1 2>&1`;
e69a2255 110$a =~ s/-e syntax OK\n//g;
d2bc402e 111$a =~ s/.*possible typo.*\n//; # Remove warning line
87a42246
MS
112$a =~ s{\\340\\242}{\\s} if (ord("\\") == 224); # EBCDIC, cp 1047 or 037
113$a =~ s{\\274\\242}{\\s} if (ord("\\") == 188); # $^O eq 'posix-bc'
114$b = <<'EOF';
d2bc402e
RGS
115BEGIN { $^I = ".bak"; }
116BEGIN { $^W = 1; }
117BEGIN { $/ = "\n"; $\ = "\n"; }
87a42246
MS
118LINE: while (defined($_ = <ARGV>)) {
119 chomp $_;
f86ea535 120 our(@F) = split(' ', $_, 0);
87a42246
MS
121 '???';
122}
87a42246 123EOF
507a68aa
NC
124is($a, $b,
125 'command line flags deparse as BEGIN blocks setting control variables');
87a42246 126
5b4ee549
NC
127$a = `$^X $path "-MO=Deparse" -e "use constant PI => 4" 2>&1`;
128$a =~ s/-e syntax OK\n//g;
129is($a, "use constant ('PI', 4);\n",
130 "Proxy Constant Subroutines must not show up as (incorrect) prototypes");
131
579a54dc 132#Re: perlbug #35857, patch #24505
b3980c39
YO
133#handle warnings::register-ed packages properly.
134package B::Deparse::Wrapper;
135use strict;
136use warnings;
137use warnings::register;
138sub getcode {
579a54dc 139 my $deparser = B::Deparse->new();
b3980c39
YO
140 return $deparser->coderef2text(shift);
141}
142
2990415a
FR
143package Moo;
144use overload '0+' => sub { 42 };
145
b3980c39
YO
146package main;
147use strict;
148use warnings;
71c4dbc3 149use constant GLIPP => 'glipp';
2990415a
FR
150use constant PI => 4;
151use constant OVERLOADED_NUMIFICATION => bless({}, 'Moo');
3779476a 152use Fcntl qw/O_TRUNC O_APPEND O_EXCL/;
aaf9c2b2 153BEGIN { delete $::Fcntl::{O_APPEND}; }
2990415a 154use POSIX qw/O_CREAT/;
b3980c39 155sub test {
579a54dc
RGS
156 my $val = shift;
157 my $res = B::Deparse::Wrapper::getcode($val);
507a68aa
NC
158 like($res, qr/use warnings/,
159 '[perl #35857] [PATCH] B::Deparse doesnt handle warnings register properly');
b3980c39
YO
160}
161my ($q,$p);
162my $x=sub { ++$q,++$p };
163test($x);
164eval <<EOFCODE and test($x);
165 package bar;
166 use strict;
167 use warnings;
168 use warnings::register;
169 package main;
170 1
171EOFCODE
172
640d5d41
FC
173# [perl #33752]
174{
175 my $code = <<"EOCODE";
176{
177 our \$\x{1e1f}\x{14d}\x{14d};
178}
179EOCODE
180 my $deparsed
181 = $deparse->coderef2text(eval "sub { our \$\x{1e1f}\x{14d}\x{14d} }" );
182 s/$ \n//x for $deparsed, $code;
183 is $deparsed, $code, 'our $funny_Unicode_chars';
184}
185
507a68aa
NC
186done_testing();
187
ad46c0be 188__DATA__
507a68aa 189# A constant
ad46c0be
RH
1901;
191####
507a68aa 192# Constants in a block
ad46c0be
RH
193{
194 no warnings;
195 '???';
196 2;
197}
198####
507a68aa 199# Lexical and simple arithmetic
ad46c0be
RH
200my $test;
201++$test and $test /= 2;
202>>>>
203my $test;
204$test /= 2 if ++$test;
205####
507a68aa 206# list x
ad46c0be
RH
207-((1, 2) x 2);
208####
507a68aa 209# lvalue sub
ad46c0be
RH
210{
211 my $test = sub : lvalue {
212 my $x;
213 }
214 ;
215}
216####
507a68aa 217# method
ad46c0be
RH
218{
219 my $test = sub : method {
220 my $x;
221 }
222 ;
223}
224####
507a68aa 225# block with continue
87a42246 226{
ad46c0be 227 234;
f99a63a2 228}
ad46c0be
RH
229continue {
230 123;
87a42246 231}
ce4e655d 232####
507a68aa 233# lexical and package scalars
ce4e655d
RH
234my $x;
235print $main::x;
236####
507a68aa 237# lexical and package arrays
ce4e655d
RH
238my @x;
239print $main::x[1];
14a55f98 240####
507a68aa 241# lexical and package hashes
14a55f98
RH
242my %x;
243$x{warn()};
ad8caead 244####
507a68aa 245# <>
ad8caead
RGS
246my $foo;
247$_ .= <ARGV> . <$foo>;
cef22867 248####
507a68aa 249# \x{}
cef22867 250my $foo = "Ab\x{100}\200\x{200}\377Cd\000Ef\x{1000}\cA\x{2000}\cZ";
4ae52e81 251####
507a68aa 252# s///e
4ae52e81 253s/x/'y';/e;
241416b8 254####
507a68aa 255# block
241416b8
DM
256{ my $x; }
257####
507a68aa 258# while 1
241416b8
DM
259while (1) { my $k; }
260####
507a68aa 261# trailing for
241416b8
DM
262my ($x,@a);
263$x=1 for @a;
264>>>>
265my($x, @a);
0bb5f065 266$x = 1 foreach (@a);
241416b8 267####
507a68aa 268# 2 arguments in a 3 argument for
241416b8
DM
269for (my $i = 0; $i < 2;) {
270 my $z = 1;
271}
272####
507a68aa 273# 3 argument for
241416b8
DM
274for (my $i = 0; $i < 2; ++$i) {
275 my $z = 1;
276}
277####
507a68aa 278# 3 argument for again
241416b8
DM
279for (my $i = 0; $i < 2; ++$i) {
280 my $z = 1;
281}
282####
507a68aa 283# while/continue
241416b8
DM
284my $i;
285while ($i) { my $z = 1; } continue { $i = 99; }
286####
507a68aa 287# foreach with my
09d856fb 288foreach my $i (1, 2) {
241416b8
DM
289 my $z = 1;
290}
291####
507a68aa 292# foreach
241416b8
DM
293my $i;
294foreach $i (1, 2) {
295 my $z = 1;
296}
297####
507a68aa 298# foreach, 2 mys
241416b8
DM
299my $i;
300foreach my $i (1, 2) {
301 my $z = 1;
302}
303####
507a68aa 304# foreach
241416b8
DM
305foreach my $i (1, 2) {
306 my $z = 1;
307}
308####
507a68aa 309# foreach with our
241416b8
DM
310foreach our $i (1, 2) {
311 my $z = 1;
312}
313####
507a68aa 314# foreach with my and our
241416b8
DM
315my $i;
316foreach our $i (1, 2) {
317 my $z = 1;
318}
3ac6e0f9 319####
507a68aa 320# reverse sort
3ac6e0f9
RGS
321my @x;
322print reverse sort(@x);
323####
507a68aa 324# sort with cmp
3ac6e0f9
RGS
325my @x;
326print((sort {$b cmp $a} @x));
327####
507a68aa 328# reverse sort with block
3ac6e0f9
RGS
329my @x;
330print((reverse sort {$b <=> $a} @x));
36d57d93 331####
507a68aa 332# foreach reverse
36d57d93
RGS
333our @a;
334print $_ foreach (reverse @a);
aae53c41 335####
507a68aa 336# foreach reverse (not inplace)
aae53c41
RGS
337our @a;
338print $_ foreach (reverse 1, 2..5);
f86ea535 339####
507a68aa 340# bug #38684
f86ea535
SM
341our @ary;
342@ary = split(' ', 'foo', 0);
31c6271a 343####
507a68aa 344# bug #40055
31c6271a
RD
345do { () };
346####
507a68aa 347# bug #40055
31c6271a 348do { my $x = 1; $x };
d9002312 349####
507a68aa 350# <20061012113037.GJ25805@c4.convolution.nl>
d9002312
SM
351my $f = sub {
352 +{[]};
353} ;
8b2d6640 354####
507a68aa 355# bug #43010
8b2d6640
FC
356'!@$%'->();
357####
507a68aa 358# bug #43010
8b2d6640
FC
359::();
360####
507a68aa 361# bug #43010
8b2d6640
FC
362'::::'->();
363####
507a68aa 364# bug #43010
8b2d6640 365&::::;
09d856fb 366####
507a68aa 367# variables as method names
09d856fb
CK
368my $bar;
369'Foo'->$bar('orz');
370####
507a68aa 371# constants as method names
09d856fb
CK
372'Foo'->bar('orz');
373####
507a68aa 374# constants as method names without ()
09d856fb 375'Foo'->bar;
0ced6c29 376####
e9c69003 377# SKIP ?$] < 5.010 && "say not implemented on this Perl version"
507a68aa 378# say
7ddd1a01
NC
379say 'foo';
380####
e9c69003 381# SKIP ?$] < 5.010 && "state vars not implemented on this Perl version"
507a68aa 382# state vars
0ced6c29
RGS
383state $x = 42;
384####
e9c69003 385# SKIP ?$] < 5.010 && "state vars not implemented on this Perl version"
507a68aa 386# state var assignment
7ddd1a01
NC
387{
388 my $y = (state $x = 42);
389}
390####
e9c69003 391# SKIP ?$] < 5.010 && "state vars not implemented on this Perl version"
c4a6f826 392# state vars in anonymous subroutines
7ddd1a01
NC
393$a = sub {
394 state $x;
395 return $x++;
396}
397;
644741fd
NC
398####
399# SKIP ?$] < 5.011 && 'each @array not implemented on this Perl version'
507a68aa 400# each @array;
644741fd
NC
401each @ARGV;
402each @$a;
403####
404# SKIP ?$] < 5.011 && 'each @array not implemented on this Perl version'
507a68aa 405# keys @array; values @array
644741fd
NC
406keys @$a if keys @ARGV;
407values @ARGV if values @$a;
35925e80 408####
507a68aa 409# Anonymous arrays and hashes, and references to them
35925e80
RGS
410my $a = {};
411my $b = \{};
412my $c = [];
413my $d = \[];
9210de83
FR
414####
415# SKIP ?$] < 5.010 && "smartmatch and given/when not implemented on this Perl version"
507a68aa 416# implicit smartmatch in given/when
9210de83
FR
417given ('foo') {
418 when ('bar') { continue; }
419 when ($_ ~~ 'quux') { continue; }
420 default { 0; }
421}
7ecdd211 422####
507a68aa 423# conditions in elsifs (regression in change #33710 which fixed bug #37302)
7ecdd211
PJ
424if ($a) { x(); }
425elsif ($b) { x(); }
426elsif ($a and $b) { x(); }
427elsif ($a or $b) { x(); }
428else { x(); }
03b22f1b 429####
507a68aa 430# interpolation in regexps
03b22f1b
RGS
431my($y, $t);
432/x${y}z$t/;
227375e1 433####
4a4b8592 434# TODO new undocumented cpan-bug #33708
507a68aa 435# cpan-bug #33708
227375e1
RU
436%{$_ || {}}
437####
4a4b8592 438# TODO hash constants not yet fixed
507a68aa 439# cpan-bug #33708
227375e1
RU
440use constant H => { "#" => 1 }; H->{"#"}
441####
4a4b8592 442# TODO optimized away 0 not yet fixed
507a68aa 443# cpan-bug #33708
227375e1 444foreach my $i (@_) { 0 }
edbe35ea 445####
507a68aa 446# tests with not, not optimized
07f3cdf5 447my $c;
edbe35ea
VP
448x() unless $a;
449x() if not $a and $b;
450x() if $a and not $b;
451x() unless not $a and $b;
452x() unless $a and not $b;
453x() if not $a or $b;
454x() if $a or not $b;
455x() unless not $a or $b;
456x() unless $a or not $b;
07f3cdf5
VP
457x() if $a and not $b and $c;
458x() if not $a and $b and not $c;
459x() unless $a and not $b and $c;
460x() unless not $a and $b and not $c;
461x() if $a or not $b or $c;
462x() if not $a or $b or not $c;
463x() unless $a or not $b or $c;
464x() unless not $a or $b or not $c;
edbe35ea 465####
507a68aa 466# tests with not, optimized
07f3cdf5 467my $c;
edbe35ea
VP
468x() if not $a;
469x() unless not $a;
470x() if not $a and not $b;
471x() unless not $a and not $b;
472x() if not $a or not $b;
473x() unless not $a or not $b;
07f3cdf5
VP
474x() if not $a and not $b and $c;
475x() unless not $a and not $b and $c;
476x() if not $a or not $b or $c;
477x() unless not $a or not $b or $c;
478x() if not $a and not $b and not $c;
479x() unless not $a and not $b and not $c;
480x() if not $a or not $b or not $c;
481x() unless not $a or not $b or not $c;
482x() unless not $a or not $b or not $c;
edbe35ea 483>>>>
07f3cdf5 484my $c;
edbe35ea
VP
485x() unless $a;
486x() if $a;
487x() unless $a or $b;
488x() if $a or $b;
489x() unless $a and $b;
07f3cdf5
VP
490x() if $a and $b;
491x() if not $a || $b and $c;
492x() unless not $a || $b and $c;
493x() if not $a && $b or $c;
494x() unless not $a && $b or $c;
495x() unless $a or $b or $c;
496x() if $a or $b or $c;
497x() unless $a and $b and $c;
498x() if $a and $b and $c;
499x() unless not $a && $b && $c;
71c4dbc3 500####
507a68aa 501# tests that should be constant folded
71c4dbc3
VP
502x() if 1;
503x() if GLIPP;
504x() if !GLIPP;
505x() if GLIPP && GLIPP;
506x() if !GLIPP || GLIPP;
507x() if do { GLIPP };
508x() if do { no warnings 'void'; 5; GLIPP };
509x() if do { !GLIPP };
510if (GLIPP) { x() } else { z() }
511if (!GLIPP) { x() } else { z() }
512if (GLIPP) { x() } elsif (GLIPP) { z() }
513if (!GLIPP) { x() } elsif (GLIPP) { z() }
514if (GLIPP) { x() } elsif (!GLIPP) { z() }
515if (!GLIPP) { x() } elsif (!GLIPP) { z() }
516if (!GLIPP) { x() } elsif (!GLIPP) { z() } elsif (GLIPP) { t() }
517if (!GLIPP) { x() } elsif (!GLIPP) { z() } elsif (!GLIPP) { t() }
518if (!GLIPP) { x() } elsif (!GLIPP) { z() } elsif (!GLIPP) { t() }
519>>>>
520x();
521x();
522'???';
523x();
524x();
525x();
526x();
527do {
528 '???'
529};
530do {
531 x()
532};
533do {
534 z()
535};
536do {
537 x()
538};
539do {
540 z()
541};
542do {
543 x()
544};
545'???';
546do {
547 t()
548};
549'???';
550!1;
551####
719c50dc
RGS
552# TODO constant deparsing has been backed out for 5.12
553# XXXTODO ? $Config::Config{useithreads} && "doesn't work with threads"
507a68aa 554# tests that shouldn't be constant folded
ac0f1413
NC
555# It might be fundamentally impossible to make this work on ithreads, in which
556# case the TODO should become a SKIP
71c4dbc3
VP
557x() if $a;
558if ($a == 1) { x() } elsif ($b == 2) { z() }
559if (do { foo(); GLIPP }) { x() }
560if (do { $a++; GLIPP }) { x() }
561>>>>
562x() if $a;
563if ($a == 1) { x(); } elsif ($b == 2) { z(); }
2990415a
FR
564if (do { foo(); GLIPP }) { x(); }
565if (do { ++$a; GLIPP }) { x(); }
566####
0fa4a265 567# TODO constant deparsing has been backed out for 5.12
507a68aa 568# tests for deparsing constants
2990415a
FR
569warn PI;
570####
0fa4a265 571# TODO constant deparsing has been backed out for 5.12
507a68aa 572# tests for deparsing imported constants
3779476a 573warn O_TRUNC;
2990415a 574####
0fa4a265 575# TODO constant deparsing has been backed out for 5.12
507a68aa 576# tests for deparsing re-exported constants
2990415a
FR
577warn O_CREAT;
578####
0fa4a265 579# TODO constant deparsing has been backed out for 5.12
507a68aa 580# tests for deparsing imported constants that got deleted from the original namespace
aaf9c2b2 581warn O_APPEND;
2990415a 582####
0fa4a265
DM
583# TODO constant deparsing has been backed out for 5.12
584# XXXTODO ? $Config::Config{useithreads} && "doesn't work with threads"
507a68aa 585# tests for deparsing constants which got turned into full typeglobs
ac0f1413
NC
586# It might be fundamentally impossible to make this work on ithreads, in which
587# case the TODO should become a SKIP
2990415a
FR
588warn O_EXCL;
589eval '@Fcntl::O_EXCL = qw/affe tiger/;';
590warn O_EXCL;
591####
0fa4a265 592# TODO constant deparsing has been backed out for 5.12
507a68aa 593# tests for deparsing of blessed constant with overloaded numification
2990415a 594warn OVERLOADED_NUMIFICATION;
79289e05
NC
595####
596# TODO Only strict 'refs' currently supported
507a68aa 597# strict
79289e05
NC
598no strict;
599$x;
600####
601# TODO Subsets of warnings could be encoded textually, rather than as bitflips.
507a68aa 602# subsets of warnings
79289e05
NC
603no warnings 'deprecated';
604my $x;
605####
606# TODO Better test for CPAN #33708 - the deparsed code has different behaviour
507a68aa 607# CPAN #33708
79289e05
NC
608use strict;
609no warnings;
610
611foreach (0..3) {
612 my $x = 2;
613 {
614 my $x if 0;
615 print ++$x, "\n";
616 }
617}
d83f38d8 618####
507a68aa 619# no attribute list
d83f38d8
NC
620my $pi = 4;
621####
2dc78664
NC
622# SKIP ?$] > 5.013006 && ":= is now a syntax error"
623# := treated as an empty attribute list
d83f38d8
NC
624no warnings;
625my $pi := 4;
626>>>>
627no warnings;
628my $pi = 4;
629####
507a68aa 630# : = empty attribute list
d83f38d8
NC
631my $pi : = 4;
632>>>>
633my $pi = 4;
689e417f 634####
507a68aa 635# in place sort
689e417f
VP
636our @a;
637my @b;
638@a = sort @a;
639@b = sort @b;
640();
641####
507a68aa 642# in place reverse
689e417f
VP
643our @a;
644my @b;
645@a = reverse @a;
646@b = reverse @b;
647();
06fc6867 648####
507a68aa 649# #71870 Use of uninitialized value in bitwise and B::Deparse
06fc6867
VP
650my($r, $s, @a);
651@a = split(/foo/, $s, 0);
652$r = qr/foo/;
653@a = split(/$r/, $s, 0);
654();
98a1a137 655####
507a68aa 656# package declaration before label
98a1a137
Z
657{
658 package Foo;
659 label: print 123;
660}
538f5756 661####
507a68aa 662# shift optimisation
538f5756
RZ
663shift;
664>>>>
665shift();
666####
507a68aa 667# shift optimisation
538f5756
RZ
668shift @_;
669####
507a68aa 670# shift optimisation
538f5756
RZ
671pop;
672>>>>
673pop();
674####
507a68aa 675# shift optimisation
538f5756 676pop @_;
a539498a 677####
507a68aa 678#[perl #20444]
a539498a
FC
679"foo" =~ (1 ? /foo/ : /bar/);
680"foo" =~ (1 ? y/foo// : /bar/);
681"foo" =~ (1 ? s/foo// : /bar/);
682>>>>
683'foo' =~ ($_ =~ /foo/);
684'foo' =~ ($_ =~ tr/fo//);
685'foo' =~ ($_ =~ s/foo//);
e0ab66ad
NC
686####
687# Test @threadsv_names under 5005threads
688foreach $' (1, 2) {
689 sleep $';
690}
e7afc405
FC
691####
692# y///r
693tr/a/b/r;
cb8157e3
FC
694####
695# y/uni/code/
696tr/\x{345}/\x{370}/;