/[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 33 by dpavlin, Sun Mar 22 17:31:40 2009 UTC revision 34 by dpavlin, Sun Mar 22 17:37:46 2009 UTC
# Line 3  Line 3 
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
6  use Test::More tests => 84;  use Test::More tests => 86;
7    
8  use lib 'lib';  use lib 'lib';
9    
# Line 134  cmp_ok( $o->scard( $set ), '==', 0, 'sca Line 134  cmp_ok( $o->scard( $set ), '==', 0, 'sca
134  $o->sadd( 'test-set1', $_ ) foreach ( 'foo', 'bar', 'baz' );  $o->sadd( 'test-set1', $_ ) foreach ( 'foo', 'bar', 'baz' );
135  $o->sadd( 'test-set2', $_ ) foreach ( 'foo', 'baz', 'xxx' );  $o->sadd( 'test-set2', $_ ) foreach ( 'foo', 'baz', 'xxx' );
136    
137  is_deeply( [ $o->sinter( 'test-set1', 'test-set2' ) ], [ 'baz', 'foo' ], 'siter' );  my $inter = [ 'baz', 'foo' ];
138    
139    is_deeply( [ $o->sinter( 'test-set1', 'test-set2' ) ], $inter, 'siter' );
140    
141    ok( $o->sinterstore( 'test-set-inter', 'test-set1', 'test-set2' ), 'sinterstore' );
142    
143    cmp_ok( $o->scard( 'test-set-inter' ), '==', $#$inter + 1, 'cardinality of intersection' );
144    
145  ok( $o->quit, 'quit' );  ok( $o->quit, 'quit' );

Legend:
Removed from v.33  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26