Added tests with big values
authorPedro Melo <melo@simplicidade.org>
Thu, 5 Aug 2010 11:44:12 +0000 (12:44 +0100)
committerPedro Melo <melo@simplicidade.org>
Thu, 5 Aug 2010 11:44:12 +0000 (12:44 +0100)
Signed-off-by: Pedro Melo <melo@simplicidade.org>
t/01-Redis.t

index 8157773..393b272 100755 (executable)
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 111;
+use Test::More tests => 121;
 use Test::Exception;
 use Data::Dumper;
 
@@ -42,6 +42,12 @@ cmp_ok( $o->get( 'utf8' ), 'eq', $euro, 'get utf8' );
 ok( $o->set( 'test-undef' => 42 ), 'set test-undef' );
 ok( $o->exists( 'test-undef' ), 'exists undef' );
 
+for my $size (10_000, 100_000, 500_000, 1_000_000, 2_500_000) {
+  my $v = 'a' x $size;
+  ok( $o->set('big_key', $v), "set with value size $size ok" );
+  is( $o->get('big_key'), $v, "... and get was ok to" );
+}
+
 $o->del('non-existant');
 
 ok( ! $o->exists( 'non-existant' ), 'exists non-existant' );