Subject: | Changed behavior - get() returns an array with a single, undef element when no results are found |
Again, not sure when this changed, but as of v0.205, if get() failed to match anything, the resulting array was empty.
Attaching a script which shows the problem.
Subject: | json_path_get_bug.pl |
#! /usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Data::Dumper;
use JSON::Path;
my $orig = { bar => 1 };
my $p = JSON::Path->new("\$foo");
my @res = $p->get($orig);
is_deeply ( \@res, [ ], "result array when no match" );
done_testing();