File: scalar.t

package info (click to toggle)
libtie-dxhash-perl 1.05-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 152 kB
  • sloc: perl: 108; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 323 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use Test::More tests => 2;

use Tie::DxHash;

my %dx_hash;
tie( %dx_hash, Tie::DxHash );

is( scalar %dx_hash,
    0, 'scalar %dx_hash returns zero for an empty tied hash' );

$dx_hash{foo} = '1';
$dx_hash{bar} = '2';
$dx_hash{bar} = '3';
is( scalar %dx_hash, 3,
    'scalar %dx_hash returns the correct number of keys' );