mirror of
https://github.com/amigan/aim-oscar-server.git
synced 2024-11-22 04:29:47 -05:00
20 lines
630 B
JavaScript
20 lines
630 B
JavaScript
const assert = require('assert');
|
|
|
|
const { FLAP, SNAC, TLV } = require('../src/structures');
|
|
|
|
const tests = [
|
|
() => {
|
|
// Construct and test a CLI_AUTH_REQUEST
|
|
const md5_auth_req = new FLAP(0x02, 0, new SNAC(0x17, 0x06, 0x0000, 0, [new TLV(0x0001, Buffer.from("toof"))]));
|
|
assert(md5_auth_req.channel === 2);
|
|
assert(md5_auth_req.payload instanceof SNAC);
|
|
assert(md5_auth_req.payload.family === 23);
|
|
assert(md5_auth_req.payload.service === 6);
|
|
assert(md5_auth_req.payload.payload.length === 1);
|
|
assert(md5_auth_req.payload.payload[0].len === 4);
|
|
}
|
|
];
|
|
|
|
tests.forEach((testFn) => {
|
|
testFn();
|
|
});
|