Re: [PATCH] another Storable test (Re: perl@16005)
[p5sagit/p5-mst-13.2.git] / ext / Storable / t / utf8.t
CommitLineData
e16e2ff8 1#!./perl -w
dd19458b 2
3# $Id: utf8.t,v 1.0.1.2 2000/09/28 21:44:17 ram Exp $
4#
e16e2ff8 5# Copyright (c) 1995-2000, Raphael Manfredi
6#
7# You may redistribute only under the same terms as Perl 5, as specified
8# in the README file that comes with the distribution.
dd19458b 9#
10# $Log: utf8.t,v $
11# Revision 1.0.1.2 2000/09/28 21:44:17 ram
12# patch2: fixed stupid typo
13#
14# Revision 1.0.1.1 2000/09/17 16:48:12 ram
15# patch1: created.
16#
17#
18
19sub BEGIN {
20 if ($] < 5.006) {
21 print "1..0 # Skip: no utf8 support\n";
22 exit 0;
23 }
0c384302 24 if ($ENV{PERL_CORE}){
25 chdir('t') if -d 't';
26 @INC = '.';
27 push @INC, '../lib';
28 }
dd19458b 29 require Config; import Config;
0c384302 30 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
dd19458b 31 print "1..0 # Skip: Storable was not built\n";
32 exit 0;
33 }
34 require 'lib/st-dump.pl';
35}
36
e16e2ff8 37use strict;
dd19458b 38sub ok;
39
40use Storable qw(thaw freeze);
41
e16e2ff8 42print "1..3\n";
dd19458b 43
e16e2ff8 44my $x = chr(1234);
dd19458b 45ok 1, $x eq ${thaw freeze \$x};
46
e16e2ff8 47# Long scalar
48$x = join '', map {chr $_} (0..1023);
49ok 2, $x eq ${thaw freeze \$x};
50
51# Char in the range 127-255 (probably) in utf8
52$x = chr (175) . chr (256);
53chop $x;
54ok 3, $x eq ${thaw freeze \$x};