covertable
Version:
Efficient TypeScript library for pairwise testing, generating minimal covering arrays with constraint support.
32 lines (31 loc) • 854 B
JavaScript
import { g as a, h as c, C as s, N as i } from "./controller-LAPl-CwL.js";
const l = (t, e) => Math.random() > 0.5 ? 1 : -1;
function m(t, e) {
return t.sort(l);
}
function* u(t) {
const e = t.incomplete;
for (let n of e.values()) {
const o = t.getCandidate(n), r = t.storable(o);
r === null || r === 0 || (yield n);
}
}
const h = function* (t, e = {}) {
yield* new s(t, e).makeAsync();
}, f = (t, e = {}) => {
const n = new s(t, e), o = n.make();
if (n.stats.uncoveredPairs.length > 0)
throw new i(
`Unable to cover ${n.stats.uncoveredPairs.length} remaining pair(s) without violating constraints`,
n.stats.uncoveredPairs
);
return o;
}, g = { hash: c, random: m }, p = { greedy: a, simple: u };
export {
s as Controller,
i as NeverMatch,
p as criteria,
f as make,
h as makeAsync,
g as sorters
};