mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-04 07:02:45 +08:00
22 lines
686 B
JavaScript
22 lines
686 B
JavaScript
/*eslint no-unused-expressions: 0, prefer-arrow-callback: 0 */
|
|
|
|
'use strict';
|
|
|
|
const imapTools = require('../lib/imap-tools');
|
|
const chai = require('chai');
|
|
const expect = chai.expect;
|
|
chai.config.includeStack = true;
|
|
|
|
describe('#packMessageRange', function() {
|
|
it('should return as is', function() {
|
|
expect(imapTools.packMessageRange([1, 3, 5, 9])).to.equal('1,3,5,9');
|
|
});
|
|
|
|
it('should return a range', function() {
|
|
expect(imapTools.packMessageRange([1, 2, 3, 4])).to.equal('1:4');
|
|
});
|
|
|
|
it('should return mixed ranges', function() {
|
|
expect(imapTools.packMessageRange([1, 3, 4, 6, 8, 9, 10, 11, 13])).to.equal('1,3:4,6,8:11,13');
|
|
});
|
|
});
|