Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
assert.match() is what i was looking for earlier. added test for vers…
Browse files Browse the repository at this point in the history
…ion()
  • Loading branch information
iamcal committed Aug 27, 2010
1 parent ac76422 commit a3a77ad
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions test/test-memcache.js
Expand Up @@ -123,22 +123,22 @@ mc.addHandler(function() {
mc.increment('inc_bad', 2, function(ok, err){
n++;
assert.equal(ok, null);
assert.equal(err.substr(0, 12), 'CLIENT_ERROR');
assert.match(err, /^CLIENT_ERROR/);
});
mc.decrement('inc_bad', 3, function(ok, err){
n++;
assert.equal(ok, null);
assert.equal(err.substr(0, 12), 'CLIENT_ERROR');
assert.match(err, /^CLIENT_ERROR/);
});
mc.increment('inc_bad', null, function(ok, err){
n++;
assert.equal(ok, null);
assert.equal(err.substr(0, 12), 'CLIENT_ERROR');
assert.match(err, /^CLIENT_ERROR/);
});
mc.decrement('inc_bad', null, function(ok, err){
n++;
assert.equal(ok, null);
assert.equal(err.substr(0, 12), 'CLIENT_ERROR');
assert.match(err, /^CLIENT_ERROR/);
});
});

Expand Down Expand Up @@ -168,4 +168,15 @@ mc.addHandler(function() {
});

};

exports['version'] = function(assert, beforeExit){

mc.version(function(success, error){

assert.equal(error, null);
assert.length(success, 5);
});

}

});

0 comments on commit a3a77ad

Please sign in to comment.