mirror of
https://github.com/PR0M3TH3AN/bitgate.git
synced 2026-10-31 02:21:00 +00:00
feat: add fixture import harness and conformance test framework for BitVid parity cases
This commit is contained in:
1 parent
10326a2804
commit
1002185a03
8 files changed
+249
-20
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// Shared test utilities for conformance harness
|
||||
export function createFixture(name, state, target, expectation) {
|
||||
return {
|
||||
name,
|
||||
state: {
|
||||
adminState: state.adminState || {},
|
||||
trust: state.trust || {},
|
||||
reports: state.reports || [],
|
||||
trustedMutes: state.trustedMutes || [],
|
||||
overrides: state.overrides || {},
|
||||
},
|
||||
target,
|
||||
expectation,
|
||||
};
|
||||
}
|
||||
|
||||
export function runConformanceTest(fixture, evaluator) {
|
||||
const decision = evaluator(fixture.state, fixture.target);
|
||||
return {
|
||||
passed: JSON.stringify(decision) === JSON.stringify(fixture.expectation),
|
||||
actual: decision,
|
||||
expected: fixture.expectation,
|
||||
};
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
// Placeholder for testing module exports
|
||||
// Testing package exports
|
||||
export {};
|
||||
Reference in new issue
Block a user