From bab01eac400c341742fda306532428ab308ac0c8 Mon Sep 17 00:00:00 2001 From: booo Date: Wed, 1 Aug 2012 18:44:37 +0200 Subject: [PATCH] Add missing integeration test for date type parser. We don't parse date types in the javascript binary parser. Keep this in mind if you plan to use the binary javascript parser. --- test/integration/client/type-coercion-tests.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/integration/client/type-coercion-tests.js b/test/integration/client/type-coercion-tests.js index 2c23f130..fce8ff33 100644 --- a/test/integration/client/type-coercion-tests.js +++ b/test/integration/client/type-coercion-tests.js @@ -145,3 +145,18 @@ helper.pg.connect(helper.config, assert.calls(function(err, client) { sink.add(); }) })) + +if(!helper.config.binary) { + test("postgres date type", function() { + var client = helper.client(); + client.on('error', function(err) { + console.log(err); + client.end(); + }); + client.query("SELECT '2010-10-31'::date", assert.calls(function(err, result){ + assert.isNull(err); + assert.UTCDate(result.rows[0].date, 2010, 9, 31, 0, 0, 0, 0); + })); + client.on('drain', client.end.bind(client)); + }); +}