mirror-webgpu-cts/src/common/framework/params/exclude.ts
Kai Ninomiya 20bc11b931 Adjust the directory structure outside the tests for navigability
- Moves src/{framework,runtime,tools,constants.ts} to src/common/*
- Moves templates/ to src/common/templates/
- Moves src/suites/*/ up to src/*/
- Renames the `cts:` suite to `webgpu:`
- Unhides some files from vscode
2020-03-31 16:36:26 -07:00

23 lines
655 B
TypeScript

import { ParamSpec, ParamSpecIterable, ParamSpecIterator, paramsEquals } from './index.js';
export function pexclude(params: ParamSpecIterable, exclude: ParamSpecIterable): PExclude {
return new PExclude(params, exclude);
}
class PExclude implements ParamSpecIterable {
private cases: ParamSpecIterable;
private exclude: ParamSpec[];
constructor(cases: ParamSpecIterable, exclude: ParamSpecIterable) {
this.cases = cases;
this.exclude = Array.from(exclude);
}
*[Symbol.iterator](): ParamSpecIterator {
for (const p of this.cases) {
if (this.exclude.every(e => !paramsEquals(p, e))) {
yield p;
}
}
}
}