test-ok-autoinc.js 427 B

12345678910
  1. var assert = require('assert');
  2. var packets = require('../../../lib/packets/index.js');
  3. var packet = packets.OK.toPacket({affectedRows: 0, insertId: 1});
  4. // 5 bytes for an OK packet, plus one byte to store affectedRows plus one byte to store the insertId
  5. assert.equal( packet.length(), 11,
  6. 'OK packets with 0 affectedRows and a minimal insertId should be '+
  7. '11 bytes long, got '+packet.length()+' byte(s)' );