3 # Copyright (c) 1995-2000, Raphael Manfredi
5 # You may redistribute only under the same terms as Perl 5, as specified
6 # in the README file that comes with the distribution.
11 print "1..0 # Skip: no utf8 support\n";
15 unshift @INC, 't/compat' if $] < 5.006002;
16 require Config; import Config;
17 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
18 print "1..0 # Skip: Storable was not built\n";
25 use Storable qw(thaw freeze);
26 use Test::More tests => 6;
29 is($x, ${thaw freeze \$x});
32 $x = join '', map {chr $_} (0..1023);
33 is($x, ${thaw freeze \$x});
35 # Char in the range 127-255 (probably) in utf8
36 $x = chr(utf8::unicode_to_native(175)) . chr (256);
38 is($x, ${thaw freeze \$x});
40 # Storable needs to cope if a frozen string happens to be internal utf8
44 my $data = freeze \$x;
45 is($x, ${thaw $data});
49 is($x, ${thaw $data});
53 # This definitely isn't valid
55 like($@, qr/corrupt.*characters outside/);