mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
31 lines
488 B
Perl
31 lines
488 B
Perl
|
#!/usr/bin/perl
|
||
|
|
||
|
use warnings;
|
||
|
use strict;
|
||
|
|
||
|
use Test::More tests => 8;
|
||
|
use lib 'lib';
|
||
|
use Data::Dump qw/dump/;
|
||
|
|
||
|
BEGIN {
|
||
|
use_ok( 'Redis::List' );
|
||
|
}
|
||
|
|
||
|
my @a;
|
||
|
|
||
|
ok( my $o = tie( @a, 'Redis::List', 'test-redis-list' ), 'tie' );
|
||
|
|
||
|
isa_ok( $o, 'Redis::List' );
|
||
|
|
||
|
$o->CLEAR;
|
||
|
|
||
|
ok( ! @a, 'empty list' );
|
||
|
|
||
|
ok( @a = ( 'foo', 'bar', 'baz' ), '=' );
|
||
|
is_deeply( [ @a ], [ 'foo', 'bar', 'baz' ] );
|
||
|
|
||
|
ok( push( @a, 'push' ), 'push' );
|
||
|
is_deeply( [ @a ], [ 'foo', 'bar', 'baz', 'push' ] );
|
||
|
|
||
|
#diag dump( @a );
|