/[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 40 by dpavlin, Sun Mar 22 18:39:06 2009 UTC revision 47 by dpavlin, Mon Mar 23 11:30:40 2009 UTC
# Line 3  Line 3 
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
6  use Test::More tests => 92;  use Test::More tests => 102;
7    
8  use lib 'lib';  use lib 'lib';
9    
# Line 45  my $key_next = 3; Line 45  my $key_next = 3;
45    
46  ok( $o->set('key-left' => $key_next), 'key-left' );  ok( $o->set('key-left' => $key_next), 'key-left' );
47    
48    is_deeply( [ $o->mget( 'foo', 'key-next', 'key-left' ) ], [ 'baz', 0, 3 ], 'mget' );
49    
50  my @keys;  my @keys;
51    
52  foreach ( 0 .. $key_next ) {  foreach ( 0 .. $key_next ) {
# Line 157  ok( ! $o->exists( 'foo' ), 'gone' ); Line 159  ok( ! $o->exists( 'foo' ), 'gone' );
159  ok( $o->select( 1 ), 'select' );  ok( $o->select( 1 ), 'select' );
160  ok( $o->exists( 'foo' ), 'exists' );  ok( $o->exists( 'foo' ), 'exists' );
161    
162    ok( $o->flushdb, 'flushdb' );
163    cmp_ok( $o->dbsize, '==', 0, 'empty' );
164    
165    diag "Sorting";
166    
167    ok( $o->lpush( 'test-sort', $_ ), "put $_" ) foreach ( 1 .. 4 );
168    cmp_ok( $o->llen( 'test-sort' ), '==', 4, 'llen' );
169    
170    is_deeply( [ $o->sort( 'test-sort' )      ], [ 1,2,3,4 ], 'sort' );
171    is_deeply( [ $o->sort( 'test-sort DESC' ) ], [ 4,3,2,1 ], 'sort DESC' );
172    
173  diag "Connection handling";  diag "Connection handling";
174    
175  ok( $o->quit, 'quit' );  ok( $o->quit, 'quit' );

Legend:
Removed from v.40  
changed lines
  Added in v.47

  ViewVC Help
Powered by ViewVC 1.1.26