You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/check-closing-keyword-parity.mjs
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -413,6 +413,15 @@ const MUTATIONS = [
413
413
},
414
414
];
415
415
416
+
// Set by `selfTest()` only after a verdict is printed -- either verdict -- and
417
+
// read at the dispatch below: a `return` that leaves the function above those
418
+
// lines prints nothing and still exits 0, so a self-test that never finished
419
+
// reports as one that passed. The self-test's own exit code stays load-bearing,
420
+
// so the handshake is a flag rather than a returned sentinel. The failure path
421
+
// sets it too: the refusal below must fire only when NEITHER verdict was
422
+
// printed, never on a genuine red that already said what failed.
423
+
letselfTestReachedVerdict=false;
424
+
416
425
functionselfTest(){
417
426
constroot=repoRoot();
418
427
constfailures=[];
@@ -465,16 +474,28 @@ function selfTest() {
465
474
466
475
if(failures.length===0){
467
476
console.log(`✓ check-closing-keyword-parity --self-test: ${checked} assertions, ${MUTATIONS.length} mutations of the shipped parsers each driven to red.`);
0 commit comments