/[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

Annotation of /t/01-Redis.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations)
Sat Mar 21 21:53:15 2009 UTC (15 years, 1 month ago) by dpavlin
File MIME type: application/x-troff
File size: 505 byte(s)
test non-existing key and strip cr/lf after get value
1 dpavlin 2 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6 dpavlin 4 use Test::More tests => 93;
7 dpavlin 2
8     use lib 'lib';
9    
10     BEGIN {
11     use_ok( 'Redis' );
12     }
13    
14     ok( my $o = Redis->new(), 'new' );
15    
16     ok( $o->ping, 'ping' );
17    
18 dpavlin 3 ok( $o->set( foo => 'bar' ), 'set foo' );
19     cmp_ok( $o->get( 'foo' ), 'eq', 'bar', 'get foo' );
20    
21 dpavlin 4 ok( ! $o->get( 'non-existant' ), 'get non-existant' );
22    
23     foreach ( 0 .. 42 ) {
24     ok( $o->set( "key-$_" => $_ ), "set key-$_" );
25     cmp_ok( $o->get( "key-$_" ), 'eq', $_, "get key-$_" );
26     }
27    
28 dpavlin 2 ok( $o->quit, 'quit' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26