debian man page for test::identity

Query: test::identity

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Test::Identity(3pm)					User Contributed Perl Documentation				       Test::Identity(3pm)

NAME
"Test::Identity" - assert the referential identity of a reference
SYNOPSIS
use Test::More tests => 2; use Test::Identity; use Thingy; { my $thingy; sub get_thingy { return $thingy } sub set_thingy { $thingy = shift; } } identical( get_thingy, undef, 'get_thingy is undef' ); my $test_thingy = Thingy->new; set_thingy $test_thingy; identical( get_thingy, $thingy, 'get_thingy is now $test_thingy' );
DESCRIPTION
This module provides a single testing function, "identical". It asserts that a given reference is as expected; that is, it either refers to the same object or is "undef". It is similar to "Test::More::is" except that it uses "refaddr", ensuring that it behaves correctly even if the references under test are objects that overload stringification or numification. It also provides better diagnostics if the test fails: $ perl -MTest::More=tests,1 -MTest::Identity -e'identical [], {}' 1..1 not ok 1 # Failed test at -e line 1. # Expected an anonymous HASH ref, got an anonymous ARRAY ref # Looks like you failed 1 test of 1. $ perl -MTest::More=tests,1 -MTest::Identity -e'identical [], []' 1..1 not ok 1 # Failed test at -e line 1. # Expected an anonymous ARRAY ref to the correct object # Looks like you failed 1 test of 1.
FUNCTIONS
identical( $got, $expected, $name ) Asserts that $got refers to the same object as $expected.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.10.1 2010-11-28 Test::Identity(3pm)
Related Man Pages
test::object5.18(3) - mojave
test::harness::results(3pm) - osx
devel::refcount(3pm) - debian
user::identity::archive(3pm) - debian
user::identity::collection::emails(3pm) - debian
Similar Topics in the Unix Linux Community
ERROR-&gt; test: argument expected , what does it mean?
validate test failed
On Identity-Aware Devices: Putting Users in Control across Federated Services
Identity Services for Securing Web Applications
Test condition