test non-existing key and strip cr/lf after get value
[perl-Redis.git] / t / 01-Redis.t
index b0c52fc..0d50d6d 100755 (executable)
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 6;
+use Test::More tests => 93;
 
 use lib 'lib';
 
@@ -18,4 +18,11 @@ ok( $o->ping, 'ping' );
 ok( $o->set( foo => 'bar' ), 'set foo' );
 cmp_ok( $o->get( 'foo' ), 'eq', 'bar', 'get foo' );
 
+ok( ! $o->get( 'non-existant' ), 'get non-existant' );
+
+foreach ( 0 .. 42 ) {
+       ok(     $o->set( "key-$_" => $_ ),           "set key-$_" );
+       cmp_ok( $o->get( "key-$_"       ), 'eq', $_, "get key-$_" );
+}
+
 ok( $o->quit, 'quit' );