Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Test::Deep type check matchers
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
.shipit
Changes
MANIFEST.SKIP
Makefile.PL
README.pod

README.pod

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, Test::Deep::Type

Something went wrong with that request. Please try again.