mirror of
https://github.com/fluencelabs/redis
synced 2025-06-26 07:21:35 +00:00
New file dump format, perl client library added
This commit is contained in:
30
client-libraries/perl/t/20-Redis-Hash.t
Executable file
30
client-libraries/perl/t/20-Redis-Hash.t
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use Test::More tests => 7;
|
||||
use lib 'lib';
|
||||
use Data::Dump qw/dump/;
|
||||
|
||||
BEGIN {
|
||||
use_ok( 'Redis::Hash' );
|
||||
}
|
||||
|
||||
ok( my $o = tie( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' );
|
||||
|
||||
isa_ok( $o, 'Redis::Hash' );
|
||||
|
||||
$o->CLEAR();
|
||||
|
||||
ok( ! keys %h, 'empty' );
|
||||
|
||||
ok( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' );
|
||||
|
||||
is_deeply( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' );
|
||||
|
||||
is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' );
|
||||
|
||||
|
||||
#diag dump( \%h );
|
||||
|
Reference in New Issue
Block a user