%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-crlf.t

use strict;
use FindBin;
BEGIN { push @INC, $FindBin::Bin }

use TestYAML ();
use Test::More tests => 6;

use JSON::Syck;

{
    $JSON::Syck::SingleQuote = 0;

    my $cr = JSON::Syck::Dump( { foo => "\r" } );
    like $cr, qr/"\\r"/;

    my $lf = JSON::Syck::Dump( { foo => "\n" } );
    like $lf, qr/"\\n"/;

    my $crlf = JSON::Syck::Dump( { foo => "\r\n" } );
    like $crlf, qr/"\\r\\n"/;
}

{
    $JSON::Syck::SingleQuote = 1;

    my $cr = JSON::Syck::Dump( { foo => "\r" } );
    like $cr, qr/'\\r'/;

    my $lf = JSON::Syck::Dump( { foo => "\n" } );
    like $lf, qr/'\\n'/;

    my $crlf = JSON::Syck::Dump( { foo => "\r\n" } );
    like $crlf, qr/'\\r\\n'/;
}


Zerion Mini Shell 1.0