$self->_sock_send_bulk_number( 'SREM', $key, $member );
}
+=head2 scard
+
+ my $elements = $r->scard( $key );
+
+=cut
+
+sub scard {
+ my ( $self, $key ) = @_;
+ $self->_sock_send( 'SCARD', $key );
+}
+
=head1 AUTHOR
Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
use warnings;
use strict;
-use Test::More tests => 80;
+use Test::More tests => 82;
use lib 'lib';
ok( $o->sadd( $set, 'foo' ), 'sadd' );
ok( ! $o->sadd( $set, 'foo' ), 'sadd' );
+cmp_ok( $o->scard( $set ), '==', 1, 'scard' );
cmp_ok( $o->type( $set ), 'eq', 'set', 'type is set' );
ok( $o->srem( $set, 'foo' ), 'srem' );
ok( ! $o->srem( $set, 'foo' ), 'srem again' );
+cmp_ok( $o->scard( $set ), '==', 0, 'scard' );
ok( $o->quit, 'quit' );