Permalink
Switch branches/tags
stable gitpan_version/1.29_01 gitpan_version/1.29 gitpan_version/1.28_01 gitpan_version/1.28 gitpan_version/1.27 gitpan_version/1.26 gitpan_version/1.25 gitpan_version/1.24_02 gitpan_version/1.24_01 gitpan_version/1.24 gitpan_version/1.23_01 gitpan_version/1.23 gitpan_version/1.22_01 gitpan_version/1.22 gitpan_version/1.21_01 gitpan_version/1.21 gitpan_version/1.20_01 gitpan_version/1.20 gitpan_version/1.19 gitpan_version/1.18 gitpan_version/1.17_02 gitpan_version/1.17 gitpan_version/1.16 gitpan_version/1.15 gitpan_version/1.14 gitpan_version/1.13 gitpan_version/1.12 gitpan_version/1.11 gitpan_version/1.10_07 gitpan_version/1.10_06 gitpan_version/1.10_05 gitpan_version/1.10_04 gitpan_version/1.10_03 gitpan_version/1.10_02 gitpan_version/1.10_01 gitpan_version/1.10 gitpan_version/1.09 gitpan_version/1.08_01 gitpan_version/1.08 gitpan_version/1.07_01 gitpan_version/1.07 gitpan_version/1.06 gitpan_version/1.05 gitpan_version/1.04 gitpan_version/1.03 gitpan_version/1.02 gitpan_version/1.01 gitpan_version/1.00 gitpan_version/0.99 gitpan_version/0.98 gitpan_version/0.97 gitpan_version/0.96 gitpan_version/0.95 gitpan_version/0.94 gitpan_version/0.91 gitpan_version/0.90 gitpan_version/0.88 gitpan_version/0.87 gitpan_version/0.86 gitpan_version/0.85 gitpan_version/0.84 gitpan_version/0.82 gitpan_version/0.81 gitpan_version/0.80 gitpan_version/0.72 gitpan_version/0.71 gitpan_version/0.70 gitpan_version/0.67 gitpan_version/0.66 gitpan_version/0.65 gitpan_version/0.64 gitpan_version/0.63 gitpan_version/0.62 gitpan_version/0.61 gitpan_version/0.60 gitpan_version/0.46_01 gitpan_version/0.45 gitpan_version/0.44 gitpan_version/0.43 gitpan_version/0.42 gitpan_version/0.41 gitpan_version/0.40 gitpan_version/0.38 gitpan_version/0.37 gitpan_version/0.36 gitpan_version/0.35 gitpan_version/0.34 gitpan_version/0.33 gitpan_version/0.32 gitpan_version/0.31 gitpan_version/0.30 gitpan_version/0.29 gitpan_version/0.28 gitpan_version/0.27 gitpan_version/0.26 gitpan_version/0.25 gitpan_version/0.24 gitpan_version/0.23 gitpan_version/0.22
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (38 sloc) 1.2 KB
use strict;
use Test::More tests => 6;
use YAML::Syck;
use Tie::Hash;
{
my %h;
my $rh = \%h;
%h = ( a => 1, b => '2', c => 3.1415, d => 4 );
bless $rh => 'Tie::StdHash';
is( Dump($rh), "--- !!perl/hash:Tie::StdHash \na: 1\nb: 2\nc: '3.1415'\nd: 4\n" );
is( Dump( \%h ), "--- !!perl/hash:Tie::StdHash \na: 1\nb: 2\nc: '3.1415'\nd: 4\n" );
}
{
my %h;
my $th = tie %h, 'Tie::StdHash';
%h = ( a => 1, b => '2', c => 3.1415, d => 4 );
TODO: {
local $TODO = "Perl 5.8 seems to sometimes coerce ints into strings." unless ( $] > '5.009888' || $] < '5.007' );
is( Dump($th), "--- !!perl/hash:Tie::StdHash \na: 1\nb: 2\nc: '3.1415'\nd: 4\n" );
}
TODO: {
local $TODO = "Tied hashes don't dump";
is( Dump( \%h ), "--- !!perl/hash:Tie::StdHash \na: 1\nb: 2\nc: '3.1415'\nd: 4\n" );
}
}
{
my %h;
my $th = tie %h, 'Tie::StdHash';
$h{a} = 1;
$h{b} = '2';
$h{c} = 3.1415;
$h{d} = 4;
is( Dump($th), "--- !!perl/hash:Tie::StdHash \na: 1\nb: 2\nc: '3.1415'\nd: 4\n" );
TODO: {
local $TODO = "Tied hashes don't dump";
is( Dump( \%h ), "--- !!perl/hash:Tie::StdHash \na: 1\nb: 2\nc: '3.1415'\nd: 4\n" );
}
}