%PDF- %PDF-
Direktori : /root/.cpanm/work/1590825950.14464/YAML-Syck-1.32/t/ |
Current File : //root/.cpanm/work/1590825950.14464/YAML-Syck-1.32/t/json-singlequote.t |
use strict; use warnings; use FindBin; BEGIN { push @INC, $FindBin::Bin } use TestYAML (); use Test::More tests => 5; use JSON::Syck; { $JSON::Syck::SingleQuote = 1; my $dump; $dump = JSON::Syck::Dump(q{Some string}); is( $dump, q{'Some string'} ); #Test escaping my $thing = q{I'm sorry, Dave.}; $dump = JSON::Syck::Dump($thing); is( JSON::Syck::Load($dump), $thing ); } { $JSON::Syck::SingleQuote = 0; my $dump; $dump = JSON::Syck::Dump(q{Some string}); is( $dump, q{"Some string"} ); #Test escaping my $thing = q{I'm sorry, Dave.}; $dump = JSON::Syck::Dump($thing); is( JSON::Syck::Load($dump), $thing ); } { my $url = 'http://www.pugscode.org'; my $var = JSON::Syck::Load(<<"_EOC_"); { url: '$url' } _EOC_ is $var->{url}, $url, "no extra space in the URL"; }