parsing noData message

This commit is contained in:
brianc 2010-10-29 00:02:08 -05:00
parent 65b64ff005
commit f63659cbc5
2 changed files with 13 additions and 1 deletions

View File

@ -197,7 +197,8 @@ var messageNames = {
N: 'notice',
1: 'parseComplete',
2: 'bindComplete',
A: 'notification'
A: 'notification',
n: 'noData'
};
p.parseMessage = function() {
@ -350,6 +351,10 @@ p.parseA = function(msg) {
return msg;
};
p.parsen = function(msg) {
return msg;
};
p.readChar = function() {
return Buffer([this.buffer[this.offset++]]).toString(this.encoding);
};

View File

@ -181,6 +181,13 @@ test('Connection', function() {
});
});
test("no data message", function() {
testForMessage(Buffer([0x6e, 0, 0, 0, 4]), {
id: 'n',
name: 'noData'
});
});
test('one row message', function() {
var message = testForMessage(oneRowDescBuff, expectedOneRowMessage);
test('has one field', function() {