JSON-SIMD
view release on metacpan or search on metacpan
t/16_tied.t view on Meta::CPAN
BEGIN { $| = 1; print "1..2\n"; }
use JSON::SIMD;
use Tie::Hash;
use Tie::Array;
our $test;
sub ok($;$) {
print $_[0] ? "" : "not ", "ok ", ++$test, "\n";
}
my $js = JSON::SIMD->new;
tie my %h, 'Tie::StdHash';
%h = (a => 1);
ok ($js->encode (\%h) eq '{"a":1}');
tie my @a, 'Tie::StdArray';
@a = (1, 2);
ok ($js->encode (\@a) eq '[1,2]');
( run in 0.852 second using v1.01-cache-2.11-cpan-364913b4093 )