whitespace

This commit is contained in:
brianc 2010-10-01 00:29:16 -05:00
parent d2c22afc36
commit 5cf151ad7a
2 changed files with 7 additions and 4 deletions

View File

@ -11,7 +11,6 @@ for(var i = 0; i < charBuff.length; i++){
UTF8[char] = charBuff[i];
};
var Client = function(config) {
EventEmitter.call(this);
config = config || {};
@ -238,7 +237,6 @@ p.parseCString = function(buffer) {
return this.buffer.toString('utf8',start, this.offset - 1);
};
module.exports = {
Client: Client,
Parser: Parser

View File

@ -76,6 +76,7 @@ test('Parser on single messages', function() {
var commandCompleteBuffer = new BufferList()
.addCString("SELECT 3")
.join(true,'C');
test('parses CommandComplete message', function() {
var result = PARSE(commandCompleteBuffer)[0];
assert.same(result, {
@ -88,6 +89,7 @@ test('Parser on single messages', function() {
var emptyRowDescriptionBuffer = new BufferList()
.addInt16(0) //number of fields
.join(true,'T');
test('parses RowDescriptions', function() {
test('parses empty row description', function() {
@ -98,7 +100,9 @@ test('Parser on single messages', function() {
length: 6,
fieldCount: 0
});
assert.equal(result.fields.length, 0);
});
var addRow = function(bufferList, name, offset) {
@ -124,6 +128,7 @@ test('Parser on single messages', function() {
length: 27,
fieldCount: 1
});
assert.equal(result.fields.length, 1);
assert.same(result.fields[0], {
@ -135,6 +140,7 @@ test('Parser on single messages', function() {
dataTypeModifier: 5,
format: 'text'
});
});
test('parses two row descriptions', function() {
@ -173,7 +179,6 @@ test('Parser on single messages', function() {
format: 'text'
});
});
});
@ -188,9 +193,9 @@ test('Parser on single messages', function() {
});
});
test('parsing empty buffer returns false', function() {
var parser = PARSE(Buffer(0));
assert.equal(parser, false);
});
});