added tests to support noData & extra query scenarios but currently

failing...ignoring for now
This commit is contained in:
brianc 2010-10-29 00:46:08 -05:00
parent f63659cbc5
commit d38a7f5ed7
3 changed files with 42 additions and 1 deletions

View File

@ -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) {

View 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());
});

View File

@ -151,3 +151,4 @@ test("prepared statements on different clients", function() {
});
});