Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/motemen/perl5-test-deep-json
Provide json() function for Test::Deep comparison
https://github.com/motemen/perl5-test-deep-json
Last synced: 3 months ago
JSON representation
Provide json() function for Test::Deep comparison
- Host: GitHub
- URL: https://github.com/motemen/perl5-test-deep-json
- Owner: motemen
- License: other
- Created: 2012-10-02T11:01:19.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T11:24:53.000Z (over 6 years ago)
- Last Synced: 2024-06-18T18:38:59.338Z (7 months ago)
- Language: Perl
- Size: 22.5 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# 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 the `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 string.
# AUTHOR
motemen
# SEE ALSO
[Test::Deep](https://metacpan.org/pod/Test::Deep)
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.