update tests and maintain old behavior for backwards compatibility

master
Stefan Thomas 8 years ago
parent 8d15a90f10
commit 204feb930d

@ -14,6 +14,7 @@ function read(buf, offset) {
do {
if(counter >= l) {
read.bytes = 0
read.bytesRead = 0 // DEPRECATED
return undefined
}
b = buf[counter++]

@ -126,6 +126,7 @@ test('buffer too short', function (assert) {
while(l--) {
var val = decode(buffer.slice(0, l))
assert.equal(val, undefined)
assert.equal(decode.bytes, 0)
assert.equal(decode.bytesRead, 0)
}
assert.end()

Loading…
Cancel
Save