mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
moved more buffers into test buffer file
This commit is contained in:
parent
9c55891521
commit
3768e43e15
@ -53,6 +53,6 @@ test('query queue', function() {
|
||||
client.query('select * from bang');
|
||||
assert.empty(stream.packets);
|
||||
|
||||
stream.emit('data', buffers.ReadyForQuery);
|
||||
stream.emit('data', buffers.readyForQuery());
|
||||
assert.equal(stream.packets.length, 1);
|
||||
});
|
||||
|
||||
@ -4,22 +4,15 @@ var PARSE = function(buffer) {
|
||||
return new Parser(buffer).parse();
|
||||
};
|
||||
|
||||
var authOkBuffer = new BufferList()
|
||||
.addInt32(8)
|
||||
.join(true, 'R');
|
||||
|
||||
var paramStatusBuffer = new BufferList()
|
||||
.addCString("client_encoding")
|
||||
.addCString("UTF8")
|
||||
.join(true, 'S');
|
||||
var authOkBuffer = buffers.authenticationOk();
|
||||
var paramStatusBuffer = buffers.parameterStatus('client_encoding', 'UTF8');
|
||||
var readyForQueryBuffer = buffers.readyForQuery();
|
||||
|
||||
var backendKeyDataBuffer = new BufferList()
|
||||
.addInt32(1)
|
||||
.addInt32(2)
|
||||
.join(true,'K');
|
||||
|
||||
var readyForQueryBuffer = buffers.readyForQuery;
|
||||
|
||||
var commandCompleteBuffer = new BufferList()
|
||||
.addCString("SELECT 3")
|
||||
.join(true,'C');
|
||||
|
||||
@ -1,8 +1,24 @@
|
||||
require(__dirname+'/test-helper');
|
||||
|
||||
var buffers = {};
|
||||
buffers.readyForQuery = new BufferList()
|
||||
.add(Buffer('I'))
|
||||
.join(true,'Z');
|
||||
buffers.readyForQuery = function() {
|
||||
return new BufferList()
|
||||
.add(Buffer('I'))
|
||||
.join(true,'Z');
|
||||
};
|
||||
|
||||
buffers.authenticationOk = function() {
|
||||
return new BufferList()
|
||||
.addInt32(8)
|
||||
.join(true, 'R');
|
||||
};
|
||||
|
||||
buffers.parameterStatus = function(name, value) {
|
||||
return new BufferList()
|
||||
.addCString(name)
|
||||
.addCString(value)
|
||||
.join(true, 'S');
|
||||
|
||||
};
|
||||
|
||||
module.exports = buffers;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user