Skip to main content
Module

x/simplestatistics/test/permutations_heap.test.js

simple statistics for node & browser javascript
Go to Latest
File
/* 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();});