From 8ffdfc16e4e99d9c130dde83241efda2c7e4b5e1 Mon Sep 17 00:00:00 2001 From: ben hockey Date: Fri, 12 Aug 2011 12:17:43 -0400 Subject: [PATCH] added check for month in assert.UTCDate and fixed broken test --- test/test-helper.js | 3 +++ test/unit/client/typed-query-results-tests.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test-helper.js b/test/test-helper.js index 830cbbc..c0fc35d 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -49,6 +49,9 @@ assert.UTCDate = function(actual, year, month, day, hours, min, sec, milisecond) var actualYear = actual.getUTCFullYear(); assert.equal(actualYear, year, "expected year " + year + " but got " + actualYear); + var actualMonth = actual.getUTCMonth(); + assert.equal(actualMonth, month, "expected month " + month + " but got " + actualMonth); + var actualDate = actual.getUTCDate(); assert.equal(actualDate, day, "expected day " + day + " but got " + actualDate); diff --git a/test/unit/client/typed-query-results-tests.js b/test/unit/client/typed-query-results-tests.js index bacf25a..ec56020 100644 --- a/test/unit/client/typed-query-results-tests.js +++ b/test/unit/client/typed-query-results-tests.js @@ -75,7 +75,7 @@ test('typed results', function() { dataTypeID: 1184, actual: '2011-01-23 22:05:00.68-06', expected: function(val) { - assert.UTCDate(val, 2011, 01, 24, 4, 5, 00, 680); + assert.UTCDate(val, 2011, 0, 24, 4, 5, 00, 680); } }, { name: 'timestampz with huge miliseconds in UTC',