| 122 | } |
| 123 | |
| 124 | async function run(): Promise<void> { |
| 125 | fs.mkdirSync(outDir, { recursive: true }); |
| 126 | /* eslint-disable no-console */ |
| 127 | console.log('Parse-parity check'); |
| 128 | console.log(` branch tree: ${branchRoot}`); |
| 129 | console.log(` main tree: ${mainRoot}`); |
| 130 | |
| 131 | const branch = await runFor('branch', branchRoot); |
| 132 | const main = await runFor('main', mainRoot); |
| 133 | |
| 134 | console.log(`\nbranch sha256 = ${branch.sha}`); |
| 135 | console.log(`main sha256 = ${main.sha}`); |
| 136 | |
| 137 | if (branch.sha === main.sha) { |
| 138 | console.log('\nPARITY OK — parsed output is byte-for-byte identical across both trees.'); |
| 139 | process.exit(0); |
| 140 | } |
| 141 | console.log('\nPARITY FAILED — parsed output differs between the two trees.'); |
| 142 | reportFirstDiff(branch.ndjson, main.ndjson); |
| 143 | process.exit(1); |
| 144 | /* eslint-enable no-console */ |
| 145 | } |
| 146 | |
| 147 | void run(); |