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 Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (32 sloc) 809 Bytes
use strict;
use warnings;
use t::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";
}