node-query/node_modules/mysql2/test/unit/packets/test-ok-autoinc.js

10 lines
426 B
JavaScript

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