]> git.saurik.com Git - redis.git/blame - client-libraries/perl/t/20-Redis-Hash.t
FLUSHALL/FLUSHDB no longer sync on disk. Just increment the dirty counter by the...
[redis.git] / client-libraries / perl / t / 20-Redis-Hash.t
CommitLineData
f78fd11b 1#!/usr/bin/perl
2
3use warnings;
4use strict;
5
6use Test::More tests => 7;
7use lib 'lib';
8use Data::Dump qw/dump/;
9
10BEGIN {
11 use_ok( 'Redis::Hash' );
12}
13
14ok( my $o = tie( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' );
15
16isa_ok( $o, 'Redis::Hash' );
17
18$o->CLEAR();
19
20ok( ! keys %h, 'empty' );
21
22ok( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' );
23
24is_deeply( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' );
25
26is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' );
27
28
29#diag dump( \%h );
30