deno.land / x / simplestatistic@v7.7.1 / test / combinations.test.js

combinations.test.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* eslint no-shadow: 0 */
const test = require("tap").test;const ss = require("../");
test("combinations", function (t) { t.test("generates 1 permutation", function (t) { t.same(ss.combinations([1], 1), [[1]]); t.end(); }); t.test( "generates combinations of 1,2,3 choosing two at a time", function (t) { t.same(ss.combinations([1, 2, 3], 2), [ [1, 2], [1, 3], [2, 3] ]); t.end(); } ); t.end();});
simplestatistic

Version Info

Tagged at
2 years ago