molstar
Version:
A comprehensive macromolecular library.
25 lines • 895 B
JavaScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { combinations } from '../combination';
describe('Combination', function () {
it('test123-2', function () {
var c = combinations([1, 2, 3], 2);
expect(c).toEqual([[1, 2], [1, 3], [2, 3]]);
});
it('test1234-2', function () {
var c = combinations([1, 2, 3, 4], 2);
expect(c).toEqual([[1, 2], [1, 3], [2, 3], [1, 4], [2, 4], [3, 4]]);
});
it('test1234-1', function () {
var c = combinations([1, 2, 3, 4], 1);
expect(c).toEqual([[1], [2], [3], [4]]);
});
it('test1234-4', function () {
var c = combinations([1, 2, 3, 4], 4);
expect(c).toEqual([[1, 2, 3, 4]]);
});
});
//# sourceMappingURL=combination.spec.js.map