mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
added tests to support noData & extra query scenarios but currently
failing...ignoring for now
This commit is contained in:
parent
f63659cbc5
commit
d38a7f5ed7
@ -85,7 +85,7 @@ p.writeInt32 = function(buffer, offset, value) {
|
||||
|
||||
p.end = function() {
|
||||
var terminationBuffer = new Buffer([0x58,0,0,0,4]);
|
||||
var wrote = this.stream.end(terminationBuffer);
|
||||
var wrote = this.stream.write(terminationBuffer);
|
||||
};
|
||||
|
||||
p.query = function(text) {
|
||||
|
||||
40
test/integration/client/no-datat-tests.js
Normal file
40
test/integration/client/no-datat-tests.js
Normal file
@ -0,0 +1,40 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
|
||||
test("noData message handling", function() {
|
||||
return false;
|
||||
var client = helper.client();
|
||||
|
||||
client.query({
|
||||
name: 'boom',
|
||||
text: 'create temp table boom(id serial, size integer)'
|
||||
});
|
||||
|
||||
client.query({
|
||||
name: 'insert',
|
||||
text: 'insert into boom(size) values($1)',
|
||||
values: [100]
|
||||
});
|
||||
|
||||
client.query({
|
||||
name: 'insert',
|
||||
values: [101]
|
||||
});
|
||||
|
||||
client.connection.on('message', console.log);
|
||||
|
||||
var x = client.query({
|
||||
name: 'fetch',
|
||||
text: 'select size from boom'
|
||||
});
|
||||
|
||||
assert.raises(x, 'row', function(row) {
|
||||
assert.equal(row.fields[0], 100);
|
||||
|
||||
assert.raises(x, 'row', function(row) {
|
||||
assert.equal(row.fields[0], 101);
|
||||
});
|
||||
});
|
||||
|
||||
x.on('end', query.end());
|
||||
|
||||
});
|
||||
@ -151,3 +151,4 @@ test("prepared statements on different clients", function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user