use strict;
use warnings;
package Test::JSON::Entails;
{
$Test::JSON::Entails::VERSION = '0.2';
}
#ABSTRACT: Test whether one JSON or Perl structure entails/subsumes another
use base 'Test::Builde
r::Module';
our @EXPORT = qw(entails subsumes);
use Carp;
use JSON::Any;
use Scalar::Util qw(reftype);
my $JSON = JSON::Any->new;
sub entails ($$;$) {
my ($input, $entailed, $test_name) = @_;
$object= eval { $JSON->decode( $object ) };
if ( my $error = $@ ) {
$test->ok( 0, $test_name );
$test->diag("$item->[0] was not valid JSON");