Changeset 769

Show
Ignore:
Timestamp:
03/29/08 09:36:25 (5 months ago)
Author:
dormando
Message:

All existing tests pass.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/binary/server/t/binary.t

    r768 r769  
    141141        my $rv = $mc->getMulti(qw(xx wye zed)); 
    142142 
    143         is_deeply([1, 'ex'], $rv->{xx}, "X is correct"); 
    144         is_deeply([2, 'why'], $rv->{wye}, "Y is correct"); 
     143    # CAS is returned with all gets. 
     144    $rv->{xx}->[2]  = 0; 
     145    $rv->{wye}->[2] = 0; 
     146        is_deeply($rv->{xx}, [1, 'ex', 0], "X is correct"); 
     147        is_deeply($rv->{wye}, [2, 'why', 0], "Y is correct"); 
    145148        is(keys(%$rv), 2, "Got only two answers like we expect"); 
    146149} 
     
    158161is($mc->decr("x"), 4, "Decrease by one"); 
    159162is($mc->decr("x", 211), 0, "Floor is zero"); 
    160  
    161 <<EOT; 
    162     def testIncrDoesntExistNoCreate(self): 
    163         """Testing incr when a value doesn't exist (and not creating).""" 
    164         try: 
    165             self.mc.incr("x", exp=-1) 
    166             self.fail("Expected failure to increment non-existent key") 
    167         except MemcachedError, e: 
    168             self.assertEquals(memcacheConstants.ERR_NOT_FOUND, e.status) 
    169         self.assertNotExists("x") 
    170  
    171     def testIncrDoesntExistCreate(self): 
    172         """Testing incr when a value doesn't exist (and we make a new one)""" 
    173         self.assertNotExists("x") 
    174         self.assertEquals(19, self.mc.incr("x", init=19)) 
    175  
    176     def testDecrDoesntExistNoCreate(self): 
    177         """Testing decr when a value doesn't exist (and not creating).""" 
    178         try: 
    179             self.mc.decr("x", exp=-1) 
    180             self.fail("Expected failiure to decrement non-existent key.") 
    181         except MemcachedError, e: 
    182             self.assertEquals(memcacheConstants.ERR_NOT_FOUND, e.status) 
    183         self.assertNotExists("x") 
    184  
    185     def testDecrDoesntExistCreate(self): 
    186         """Testing decr when a value doesn't exist (and we make a new one)""" 
    187         self.assertNotExists("x") 
    188         self.assertEquals(19, self.mc.decr("x", init=19)) 
    189 EOT 
    190163 
    191164{ 
     
    433406} 
    434407 
    435 sub old_gets { 
    436         my $self = shift; 
    437         my $key = shift; 
    438  
    439         my $data = $self->_doCmd(::CMD_GET, $key, ''); 
    440         my $header = substr $data, 0, 12, ''; 
    441         my ($flags, $ident_hi, $ident_lo) = unpack "NNN", $header; 
    442         my $ident = ($ident_hi * 2 ** 32) + $ident_lo; 
    443  
    444         return $flags, $ident, $data; 
    445 } 
    446  
    447408sub noop { 
    448409        my $self = shift;