File: README.md

package info (click to toggle)
libtest-deep-json-perl 0.03-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 124 kB
  • ctags: 5
  • sloc: perl: 33; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 964 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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](http://search.cpan.org/perldoc?Test::Deep)

# LICENSE

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