]>
Commit | Line | Data |
---|---|---|
f78fd11b | 1 | #!/usr/bin/perl |
2 | ||
3 | use warnings; | |
4 | use strict; | |
5 | ||
6 | use Test::More tests => 8; | |
7 | use lib 'lib'; | |
8 | use Data::Dump qw/dump/; | |
9 | ||
10 | BEGIN { | |
11 | use_ok( 'Redis::List' ); | |
12 | } | |
13 | ||
14 | my @a; | |
15 | ||
16 | ok( my $o = tie( @a, 'Redis::List', 'test-redis-list' ), 'tie' ); | |
17 | ||
18 | isa_ok( $o, 'Redis::List' ); | |
19 | ||
20 | $o->CLEAR; | |
21 | ||
22 | ok( ! @a, 'empty list' ); | |
23 | ||
24 | ok( @a = ( 'foo', 'bar', 'baz' ), '=' ); | |
25 | is_deeply( [ @a ], [ 'foo', 'bar', 'baz' ] ); | |
26 | ||
27 | ok( push( @a, 'push' ), 'push' ); | |
28 | is_deeply( [ @a ], [ 'foo', 'bar', 'baz', 'push' ] ); | |
29 | ||
30 | #diag dump( @a ); |