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

Commit

Permalink
fixed tests for newer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
elbart committed Mar 12, 2011
1 parent d1cac0a commit 9d35a3b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/test-memcache.js
Expand Up @@ -2,21 +2,22 @@
tests for expresso
*/

var sys = require('sys');
var memcache = require('memcache');
var sys = require('sys'),
memcache = require('memcache'),
assert = require('assert');

mc = new memcache.Client();
mc.on('error', function(e){

if (e.errno == 111){
exports['startup test'] = function(assert){
exports['startup test'] = function(){

assert.ok(false, "You need to have a memcache server running on localhost:11211 for these tests to run");
}
return;
}

exports['startup test'] = function(assert){
exports['startup test'] = function(){
assert.ok(false, "Unexpected error during connection: "+sys.inspect(e));
}
});
Expand All @@ -26,7 +27,7 @@ mc.connect();
mc.addHandler(function() {

// test nonexistent key is null
exports['test null value'] = function(assert, beforeExit) {
exports['test null value'] = function(beforeExit) {
var n = 0;
mc.get('no such key', function(r) {
assert.equal(null, r);
Expand All @@ -39,7 +40,7 @@ mc.addHandler(function() {
};

// test set, get and expires
exports['test set, get, and expires'] = function(assert, beforeExit) {
exports['test set, get, and expires'] = function(beforeExit) {
var n = 0;
// set key
mc.set('set1', 'asdf1', function() {
Expand All @@ -65,7 +66,7 @@ mc.addHandler(function() {
};

// test set and delete
exports['test set del'] = function(assert, beforeExit) {
exports['test set del'] = function(beforeExit) {
var n = 0;
// set key
mc.set('set2', 'asdf2', function() {
Expand All @@ -92,7 +93,7 @@ mc.addHandler(function() {


// test connecting and disconnecting
exports['con disco'] = function(assert, beforeExit) {
exports['con disco'] = function(beforeExit) {

var n = 0;

Expand All @@ -113,7 +114,7 @@ mc.addHandler(function() {
};

// increment / decrement
exports['inc dec'] = function(assert, beforeExit){
exports['inc dec'] = function(beforeExit){

var n = 0;

Expand Down Expand Up @@ -169,7 +170,7 @@ mc.addHandler(function() {

};

exports['version'] = function(assert, beforeExit){
exports['version'] = function(beforeExit){
var n = 0;

mc.version(function(success, error){
Expand All @@ -183,7 +184,7 @@ mc.addHandler(function() {
});
};

exports['stats'] = function(assert, beforeExit){
exports['stats'] = function(beforeExit){
var n = 0;

mc.stats(function(success, error){
Expand Down

0 comments on commit 9d35a3b

Please sign in to comment.