Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fdef3a9760
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (19 sloc) 0.544 kb
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use lib 't';
use Test::More;
# ABSTRACT: Tests for the Redis SETNX command.
use_ok 'RedisClientTest';
my $redis = RedisClientTest->server;
done_testing && exit unless $redis;
isa_ok $redis, 'Redis::Client';
my $one = $redis->setnx( perl_redis_test_setnx => 'foo' );
my $zero = $redis->setnx( perl_redis_test_setnx => 'bar' );
my $val = $redis->get( 'perl_redis_test_setnx' );
is $one, 1;
is $zero, 0;
is $val, 'foo';
ok $redis->del( 'perl_redis_test_setnx' );
done_testing;
Jump to Line
Something went wrong with that request. Please try again.