mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Add failing early date tests
This commit is contained in:
parent
b38d60dc26
commit
5c233896f1
@ -150,6 +150,25 @@ test("timestampz round trip", function() {
|
||||
client.on('drain', client.end.bind(client));
|
||||
});
|
||||
|
||||
test('early AD date', function() {
|
||||
var client = helper.client();
|
||||
client.on('error', function(err) {
|
||||
console.log(err);
|
||||
client.end();
|
||||
});
|
||||
|
||||
client.query('SELECT $1::TIMESTAMPTZ as when', ["0062-03-08 14:32:00"], assert.success(function(res) {
|
||||
assert.equal(res.rows[0].when.getFullYear(), 62);
|
||||
}))
|
||||
|
||||
client.query('SELECT $1::TIMESTAMPTZ as when', ["0062-03-08 14:32:00 BC"], assert.success(function(res) {
|
||||
console.log(res.rows[0].when)
|
||||
assert.equal(res.rows[0].when.getFullYear(), 62);
|
||||
}))
|
||||
|
||||
client.on('drain', client.end.bind(client));
|
||||
})
|
||||
|
||||
helper.pg.connect(helper.config, assert.calls(function(err, client, done) {
|
||||
assert.isNull(err);
|
||||
client.query('select null as res;', assert.calls(function(err, res) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user