File: 09_magic.t

package info (click to toggle)
libhash-fieldhash-perl 0.15-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: perl: 1,249; ansic: 207; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!perl -w

use strict;
use constant HUF => eval{ require Hash::Util::FieldHash };
use Test::More HUF ? (tests => 8) : (skip_all => 'require Hash::Util::FieldHash');

use Hash::FieldHash;

Hash::FieldHash::fieldhash       my %x;
Hash::Util::FieldHash::fieldhash my %y;


{
	my $o = [];

	$x{$o} = 100;
	$y{$o} = 200;

	is_deeply [values %x], [100];
	is_deeply [values %y], [200];

	is $x{$o}, 100;
	is $y{$o}, 200;

	$x{$o}++;
	$y{$o}++;

	is $x{$o}, 101;
	is $y{$o}, 201;
}

is_deeply \%x, {};
is_deeply \%y, {};