Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 8df1d893a7
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (42 sloc) 0.71 kb
#!/usr/bin/perl
use strict;
use warnings;
use JSON::SL;
use Test::More;
my $sl = JSON::SL->new();
$sl->object_drip(1);
my $json = <<'EOJ';
[
[
{
"key1" : "foo",
"key2" : "bar",
"key3" : "baz"
}
]
EOJ
my @res = $sl->feed($json);
my $expected = [
{
Value => "foo",
Path => '/0/0/key1',
},
{
Value => "bar",
Path => '/0/0/key2',
},
{
Value => "baz",
Path => '/0/0/key3'
},
{
Value => {},
Path => '/0/0'
},
{
Value => [],
Path => '/0'
}
];
is_deeply(\@res, $expected, "Got expected results for object drip...");
done_testing();
Jump to Line
Something went wrong with that request. Please try again.