added check for month in assert.UTCDate and fixed broken test

This commit is contained in:
ben hockey 2011-08-12 12:17:43 -04:00
parent 494c167960
commit 8ffdfc16e4
2 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,9 @@ assert.UTCDate = function(actual, year, month, day, hours, min, sec, milisecond)
var actualYear = actual.getUTCFullYear(); var actualYear = actual.getUTCFullYear();
assert.equal(actualYear, year, "expected year " + year + " but got " + actualYear); 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(); var actualDate = actual.getUTCDate();
assert.equal(actualDate, day, "expected day " + day + " but got " + actualDate); assert.equal(actualDate, day, "expected day " + day + " but got " + actualDate);

View File

@ -75,7 +75,7 @@ test('typed results', function() {
dataTypeID: 1184, dataTypeID: 1184,
actual: '2011-01-23 22:05:00.68-06', actual: '2011-01-23 22:05:00.68-06',
expected: function(val) { 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', name: 'timestampz with huge miliseconds in UTC',