projects
/
perl-Redis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
support for set foo => undef
[perl-Redis.git]
/
t
/
01-Redis.t
diff --git
a/t/01-Redis.t
b/t/01-Redis.t
index
d43655a
..
2d13b97
100755
(executable)
--- a/
t/01-Redis.t
+++ b/
t/01-Redis.t
@@
-3,7
+3,7
@@
use warnings;
use strict;
use warnings;
use strict;
-use Test::More tests =>
67
;
+use Test::More tests =>
75
;
use lib 'lib';
use lib 'lib';
@@
-26,6
+26,12
@@
ok( $o->set( foo => 'baz' ), 'set foo => baz' );
cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' );
cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' );
+ok( $o->set( 'test-undef' => 42 ), 'set test-undef' );
+ok( $o->set( 'test-undef' => undef ), 'set undef' );
+ok( ! defined $o->get( 'test-undef' ), 'get undef' );
+diag $o->exists( 'test-undef' );
+ok( $o->exists( 'test-undef' ), 'exists undef' );
+
$o->del('non-existant');
ok( ! $o->exists( 'non-existant' ), 'exists non-existant' );
$o->del('non-existant');
ok( ! $o->exists( 'non-existant' ), 'exists non-existant' );
@@
-102,4
+108,11
@@
cmp_ok( $o->lindex( $list, 1 ), 'eq', 'r1', 'lindex' );
ok( $o->lset( $list, 0, 'foo' ), 'lset' );
cmp_ok( $o->lindex( $list, 0 ), 'eq', 'foo', 'verified' );
ok( $o->lset( $list, 0, 'foo' ), 'lset' );
cmp_ok( $o->lindex( $list, 0 ), 'eq', 'foo', 'verified' );
+ok( $o->lrem( $list, 1, 'foo' ), 'lrem' );
+cmp_ok( $o->llen( $list ), '==', 1, 'llen after lrem' );
+
+cmp_ok( $o->lpop( $list ), 'eq', 'r1', 'lpop' );
+
+ok( ! $o->rpop( $list ), 'rpop' );
+
ok( $o->quit, 'quit' );
ok( $o->quit, 'quit' );