Permalink
Browse files

Dropped references to 'sys' and print

Closes #20
  • Loading branch information...
1 parent 01dcc41 commit 3b71ed69c394b9babeca7db42fa925a6ef13f5fc @gsf committed Jun 27, 2012
Showing with 7 additions and 11 deletions.
  1. +2 −3 test/common.js
  2. +3 −4 test/test-query.js
  3. +2 −4 test/test-update.js
View
5 test/common.js
@@ -1,5 +1,4 @@
var assert = require('assert');
-var print = exports.print = require('sys').print;
var solr = exports.solr = require('../lib/solr');
exports.createClient = function(options) {
@@ -17,7 +16,7 @@ var wrapAssert = function(fn) {
return function() {
assert[fn].apply(this, arguments);
count++;
- print('.');
+ process.stdout.write('.');
};
};
exports.assert = {};
@@ -29,5 +28,5 @@ for (var fn in assert) {
}
process.on('exit', function() {
- print(' ran ' + count + ' of ' + exports.expected + ' tests.\n');
+ process.stdout.write(' ran ' + count + ' of ' + exports.expected + ' tests.\n');
});
View
7 test/test-query.js
@@ -1,7 +1,6 @@
var common = require('./common');
var assert = common.assert;
var client = common.createClient();
-var print = common.print;
var solr = common.solr;
common.expected = 5;
@@ -27,15 +26,15 @@ client.del(null, '*:*', function(err) { // Clean up index
if (err) throw err;
assert.equal(solr.getStatus(res), 0, 'Raw query failed.');
});
- var query = 'bob:poodle';
+ query = 'bob:poodle';
client.query(query, function(err) {
assert.equal(err.message, 'undefined field bob', "Undefined field didn't error right.");
});
- var query = 'bar_t:11:15';
+ query = 'bar_t:11:15';
client.query(query, function(err) {
assert.ok(err, "Unescaped query didn't error right.");
});
- var query = 'bar_t:' + solr.valueEscape('11:00 + 15');
+ query = 'bar_t:' + solr.valueEscape('11:00 + 15');
client.query(query, function(err, res) {
if (err) throw err;
assert.equal(JSON.parse(res).response.numFound, 1, 'Escaped query failed.');
View
6 test/test-update.js
@@ -1,7 +1,6 @@
var common = require('./common');
var assert = common.assert;
var client = common.createClient();
-var print = common.print;
var solr = common.solr;
common.expected = 9;
@@ -40,7 +39,7 @@ client.del(null, '*:*', function(err) { // Clean up index
doc = {
id: 4,
fizzbuzz_t: 'foo',
- wakak_i: '7',
+ wakak_i: '7'
};
var options = {
overwrite: false
@@ -63,7 +62,7 @@ client.del(null, '*:*', function(err) { // Clean up index
});
doc = {
fizzbuzz_t: 'foo',
- wakak_i: '5',
+ wakak_i: '5'
};
client.add(doc, function(err, res) {
assert.ok(/missing required field: id/.test(err.message), 'Add document without ID should fail.');
@@ -90,4 +89,3 @@ client.del(null, '*:*', function(err) { // Clean up index
});
});
});
-

0 comments on commit 3b71ed6

Please sign in to comment.