Test::Identity man page on Alpinelinux

Man page or keyword search:  
man Server   18016 pages
apropos Keyword Search (all sections)
Output format
Alpinelinux logo
[printable version]

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

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.18.2			  2014-05-13		     Test::Identity(3)
[top]

List of man pages available for Alpinelinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net