From 5cf151ad7a9ad17c9cb38f702040278fdd22e971 Mon Sep 17 00:00:00 2001 From: brianc Date: Fri, 1 Oct 2010 00:29:16 -0500 Subject: [PATCH] whitespace --- lib/index.js | 2 -- test/parser-tests.js | 9 +++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index c454dbb2..577bc556 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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 diff --git a/test/parser-tests.js b/test/parser-tests.js index d04f0ff5..bc31d3f4 100644 --- a/test/parser-tests.js +++ b/test/parser-tests.js @@ -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); }); + });