This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
svleak.t: Enable syntax error tests under -Dmad
[perl5.git] / t / op / concat2.t
1 #!./perl
2
3 # This file is for concatenation tests that require test.pl.
4 #
5 # concat.t cannot use test.pl as it needs to avoid using concatenation in
6 # its ok() function.
7
8 BEGIN {
9     chdir 't' if -d 't';
10     @INC = '../lib';
11     require './test.pl';
12 }
13
14 plan 2;
15
16 SKIP: {
17 skip_if_miniperl("no dynamic loading on miniperl, no Encode", 1);
18 fresh_perl_is <<'end', "ok\n", {},
19     use encoding 'utf8';
20     map { "a" . $a } ((1)x5000);
21     print "ok\n";
22 end
23  "concat does not lose its stack pointer after utf8 upgrade [perl #78674]";
24 }
25
26 # This test is in the file because overload.pm uses concatenation.
27 { package o; use overload '""' => sub { $_[0][0] } }
28 $x = bless[chr 256],o::;
29 "$x";
30 $x->[0] = "\xff";
31 $x.= chr 257;
32 $x.= chr 257;
33 is $x, "\xff\x{101}\x{101}", '.= is not confused by changing utf8ness';