NAKAGAWA Masaki > Test-Deep-Matcher > Test::Deep::Matcher

Download:
Test-Deep-Matcher-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Test::Deep::Matcher - Type check matchers for Test::Deep

SYNOPSIS ^

  use Test::More;
  use Test::Deep;
  use Test::Deep::Matcher;

  my $got = +{
      foo  => 'string',
      bar  => 100,
      baz  => [ 1, 2, 3 ],
      quux => { foo => 'bar' },
  };

  cmp_deeply($got, +{
      foo  => is_string,
      bar  => is_integer,
      baz  => is_array_ref,
      quux => is_hash_ref,
  });

  done_testing;

DESCRIPTION ^

Test::Deep::Matcher is a collection of Test::Deep type check matchers.

METHODS ^

Reference Matchers

is_scalar_ref

Checks the value type is SCALAR reference.

is_array_ref

Checks the value type is ARRAY reference.

is_hash_ref

Checks the value type is HASH reference.

is_code_ref

Checks the value type is CODE reference.

is_glob_ref

Checks the value type is GLOB reference.

Primitive Matchers

is_value

Checks the value is primitive, is not undef.

is_string

Checks the value is string, has length.

is_number

Checks the value is number.

is_integer

Checks the value is integer, is also number.

AUTHOR ^

NAKAGAWA Masaki <masaki@cpan.org>

LICENSE ^

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

SEE ALSO ^

Test::Deep, <Data::Util>

syntax highlighting: