2010-10-30 09:33:53 +08:00
|
|
|
var helper = require(__dirname+'/test-helper');
|
|
|
|
var client = helper.client();
|
|
|
|
|
|
|
|
test("empty query message handling", function() {
|
2011-03-04 02:21:43 +08:00
|
|
|
assert.emits(client, 'drain', function() {
|
2011-03-04 02:23:02 +08:00
|
|
|
client.end();
|
|
|
|
});
|
2011-11-22 11:59:54 +08:00
|
|
|
client.query({text: "", binary: false});
|
2010-10-30 09:33:53 +08:00
|
|
|
});
|
2011-02-23 09:16:05 +08:00
|
|
|
|
|
|
|
test('callback supported', assert.calls(function() {
|
2011-11-22 11:59:54 +08:00
|
|
|
client.query({text: "", binary: false}, function(err, result) {
|
2011-02-23 09:16:05 +08:00
|
|
|
assert.isNull(err);
|
|
|
|
assert.empty(result.rows);
|
|
|
|
})
|
|
|
|
}))
|
|
|
|
|