Group
Extension

Matches 1

Test-JSON-Entails ( V/VO/VOJ/Test-JSON-Entails-0.2.tar.gz, VOJ, 2012; MetaCPAN )
Test-JSON-Entails/lib/Test/JSON/Entails.pm ( view source; MetaCPAN )
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");
             

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.