deno.land / x / simplestatistics@v7.8.3 / test / permutations_heap.test.js
123456789101112131415161718192021222324/* eslint no-shadow: 0 */
const test = require("tap").test;const ss = require("../dist/simple-statistics.js");
test("permutationsHeap", function (t) { t.test("generates 1 permutation", function (t) { t.same(ss.permutationsHeap([1]), [[1]]); t.end(); }); t.test("generates 1, 2, 3 permutations", function (t) { t.same(ss.permutationsHeap([1, 2, 3]), [ [1, 2, 3], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1], [3, 2, 1] ]); t.end(); }); t.end();});
Version Info