Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Provide json() function for Test::Deep comparison
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Test/Deep
t
xt
.gitignore
Build.PL
Changes
LICENSE
META.json
README.md
cpanfile

README.md

NAME

Test::Deep::JSON - Compare JSON with Test::Deep

SYNOPSIS

use Test::Deep;
use Test::Deep::JSON;

cmp_deeply {
    foo => 'bar',
    payload => '{"a":1}',
}, {
    foo => 'bar',
    payload => json({ a => ignore() }),
};

DESCRIPTION

Test::Deep::JSON provides json($expected) function to expect that target can be parsed as a JSON string and matches (by cmp_deeply) with $expected.

FUNCTIONS

  • json($expected)

    Exported by default.

    $expected can be anything that Test::Deep recognizes.

    This parses the data as a JSON string, and compares the parsed object and $expected by Test::Deep functionality.

    Fails if the data cannot be parsed as a JSON.

AUTHOR

motemen motemen@gmail.com

SEE ALSO

Test::Deep

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Something went wrong with that request. Please try again.