3 |
use warnings; |
use warnings; |
4 |
use strict; |
use strict; |
5 |
|
|
6 |
use Test::More tests => 18; |
use Test::More tests => 28; |
7 |
|
|
8 |
use lib 'lib'; |
use lib 'lib'; |
9 |
|
|
28 |
|
|
29 |
ok( ! $o->get( 'non-existant' ), 'get non-existant' ); |
ok( ! $o->get( 'non-existant' ), 'get non-existant' ); |
30 |
|
|
31 |
foreach ( 0 .. 3 ) { |
ok( $o->set('key-next' => 0), 'key-next = 0' ); |
32 |
|
|
33 |
|
my $key_next = 3; |
34 |
|
|
35 |
|
foreach ( 0 .. $key_next ) { |
36 |
ok( $o->set( "key-$_" => $_ ), "set key-$_" ); |
ok( $o->set( "key-$_" => $_ ), "set key-$_" ); |
37 |
cmp_ok( $o->get( "key-$_" ), 'eq', $_, "get key-$_" ); |
cmp_ok( $o->get( "key-$_" ), 'eq', $_, "get key-$_" ); |
38 |
|
cmp_ok( $o->incr( 'key-next' ), '==', $_ + 1, 'incr' ); |
39 |
|
} |
40 |
|
|
41 |
|
cmp_ok( $o->get( 'key-next' ), '==', $key_next + 1, 'key-next' ); |
42 |
|
|
43 |
|
ok( $o->set('test-incrby', 0), 'test-incrby' ); |
44 |
|
foreach ( 1 .. 3 ) { |
45 |
|
cmp_ok( $o->incr('test-incrby', 3), '==', $_ * 3, 'incrby 3' ); |
46 |
} |
} |
47 |
|
|
48 |
ok( $o->quit, 'quit' ); |
ok( $o->quit, 'quit' ); |