fix massive issue in getAllPossibleCombinations
This commit is contained in:
parent
1050fed558
commit
c1568ad2ba
2 changed files with 29 additions and 5 deletions
|
|
@ -11,9 +11,23 @@ import {
|
|||
|
||||
describe.only('Theme Data 3', () => {
|
||||
describe('getAllPossibleCombinations', () => {
|
||||
it('test simple case', () => {
|
||||
it('test simple 3 values case', () => {
|
||||
const out = getAllPossibleCombinations([1, 2, 3]).map(x => x.sort((a, b) => a - b))
|
||||
expect(out).to.eql([[1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]])
|
||||
expect(out).to.eql([
|
||||
[1], [2], [3],
|
||||
[1, 2], [1, 3], [2, 3],
|
||||
[1, 2, 3]
|
||||
])
|
||||
})
|
||||
|
||||
it('test simple 4 values case', () => {
|
||||
const out = getAllPossibleCombinations([1, 2, 3, 4]).map(x => x.sort((a, b) => a - b))
|
||||
expect(out).to.eql([
|
||||
[1], [2], [3], [4],
|
||||
[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4],
|
||||
[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4],
|
||||
[1, 2, 3, 4]
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue