Test::Deep::JSON(3pm)

Test::Deep::JSON3pm

Compare json with test::deep

Usage

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

Overview

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.

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9
  2. 10–11
  3. 12–13

Author

motemen <[email protected]>

License

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

From libtest-deep-json-perl 0.05-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.