/[Redis.pre-github]/t/01-Redis.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /t/01-Redis.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8 by dpavlin, Sat Mar 21 22:48:46 2009 UTC revision 11 by dpavlin, Sat Mar 21 23:09:48 2009 UTC
# Line 3  Line 3 
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
6  use Test::More tests => 37;  use Test::More tests => 44;
7    
8  use lib 'lib';  use lib 'lib';
9    
# Line 26  ok( $o->set( foo => 'baz' ), 'set foo => Line 26  ok( $o->set( foo => 'baz' ), 'set foo =>
26    
27  cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' );  cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' );
28    
29    $o->del('non-existant');
30    
31    ok( ! $o->exists( 'non-existant' ), 'exists non-existant' );
32  ok( ! $o->get( 'non-existant' ), 'get non-existant' );  ok( ! $o->get( 'non-existant' ), 'get non-existant' );
33    
34  ok( $o->set('key-next' => 0), 'key-next = 0' );  ok( $o->set('key-next' => 0), 'key-next = 0' );
# Line 36  ok( $o->set('key-left' => $key_next), 'k Line 39  ok( $o->set('key-left' => $key_next), 'k
39    
40  foreach ( 0 .. $key_next ) {  foreach ( 0 .. $key_next ) {
41          ok(     $o->set( "key-$_" => $_ ),           "set key-$_" );          ok(     $o->set( "key-$_" => $_ ),           "set key-$_" );
42            ok(  $o->exists( "key-$_"       ),           "exists key-$_" );
43          cmp_ok( $o->get( "key-$_"       ), 'eq', $_, "get key-$_" );          cmp_ok( $o->get( "key-$_"       ), 'eq', $_, "get key-$_" );
44          cmp_ok( $o->incr( 'key-next' ), '==', $_ + 1, 'incr' );          cmp_ok( $o->incr( 'key-next' ), '==', $_ + 1, 'incr' );
45          cmp_ok( $o->decr( 'key-left' ), '==', $key_next - $_ - 1, 'decr' );          cmp_ok( $o->decr( 'key-left' ), '==', $key_next - $_ - 1, 'decr' );
# Line 50  foreach ( 1 .. 3 ) { Line 54  foreach ( 1 .. 3 ) {
54          cmp_ok( $o->decr('test-decrby', 7), '==', -( $_ * 7 ), 'decrby 7' );          cmp_ok( $o->decr('test-decrby', 7), '==', -( $_ * 7 ), 'decrby 7' );
55  }  }
56    
57    ok( $o->del('key-next' ), 'del' );
58    
59    cmp_ok( $o->type('foo'), 'eq', 'string', 'type' );
60    
61  ok( $o->quit, 'quit' );  ok( $o->quit, 'quit' );

Legend:
Removed from v.8  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.26