unit test for portal suspended

This commit is contained in:
Brian Carlson 2010-11-14 17:44:36 -06:00
parent 6585f85d03
commit e61ec5dfed
3 changed files with 15 additions and 0 deletions

View File

@ -283,6 +283,10 @@ p.parseMessage = function() {
msg.name = 'emptyQuery';
return msg;
case 0x73: //s
msg.name = 'portalSuspended';
return msg;
default:
throw new Error("Unrecognized message code " + id);
}

View File

@ -117,4 +117,8 @@ buffers.emptyQuery = function() {
return new BufferList().join(true, 'I');
};
buffers.portalSuspended = function() {
return new BufferList().join(true, 's');
};
module.exports = buffers;

View File

@ -11,6 +11,7 @@ var backendKeyDataBuffer = buffers.backendKeyData(1,2);
var commandCompleteBuffer = buffers.commandComplete("SELECT 3");
var parseCompleteBuffer = buffers.parseComplete();
var bindCompleteBuffer = buffers.bindComplete();
var portalSuspendedBuffer = buffers.portalSuspended();
var addRow = function(bufferList, name, offset) {
return bufferList.addCString(name) //field name
@ -339,6 +340,12 @@ test('Connection', function() {
name: 'bindComplete'
});
});
test('parses portal suspended message', function() {
testForMessage(portalSuspendedBuffer, {
name: 'portalSuspended'
});
});
});
//since the data message on a stream can randomly divide the incomming