3 |
use warnings; |
use warnings; |
4 |
use strict; |
use strict; |
5 |
|
|
6 |
use Test::More tests => 37; |
use Test::More tests => 42; |
7 |
|
|
8 |
use lib 'lib'; |
use lib 'lib'; |
9 |
|
|
26 |
|
|
27 |
cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' ); |
cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' ); |
28 |
|
|
29 |
|
ok( ! $o->exists( 'non-existant' ), 'exists non-existant' ); |
30 |
ok( ! $o->get( 'non-existant' ), 'get non-existant' ); |
ok( ! $o->get( 'non-existant' ), 'get non-existant' ); |
31 |
|
|
32 |
ok( $o->set('key-next' => 0), 'key-next = 0' ); |
ok( $o->set('key-next' => 0), 'key-next = 0' ); |
37 |
|
|
38 |
foreach ( 0 .. $key_next ) { |
foreach ( 0 .. $key_next ) { |
39 |
ok( $o->set( "key-$_" => $_ ), "set key-$_" ); |
ok( $o->set( "key-$_" => $_ ), "set key-$_" ); |
40 |
|
ok( $o->exists( "key-$_" ), "exists key-$_" ); |
41 |
cmp_ok( $o->get( "key-$_" ), 'eq', $_, "get key-$_" ); |
cmp_ok( $o->get( "key-$_" ), 'eq', $_, "get key-$_" ); |
42 |
cmp_ok( $o->incr( 'key-next' ), '==', $_ + 1, 'incr' ); |
cmp_ok( $o->incr( 'key-next' ), '==', $_ + 1, 'incr' ); |
43 |
cmp_ok( $o->decr( 'key-left' ), '==', $key_next - $_ - 1, 'decr' ); |
cmp_ok( $o->decr( 'key-left' ), '==', $key_next - $_ - 1, 'decr' ); |