From 97e991317d55db4f7414678a89a45921802a14b8 Mon Sep 17 00:00:00 2001 From: sechmachine <97589681+sechmachine727@users.noreply.github.com> Date: Sat, 15 Aug 2026 14:38:12 +0700 Subject: [PATCH] test: cover every fix branch guide mutation --- scripts/verify-fix-branch-workflow.cjs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/verify-fix-branch-workflow.cjs b/scripts/verify-fix-branch-workflow.cjs index ecaf72f..933ea87 100644 --- a/scripts/verify-fix-branch-workflow.cjs +++ b/scripts/verify-fix-branch-workflow.cjs @@ -62,10 +62,18 @@ const contents = readContents(); validate(contents); if (process.argv.includes('--self-test')) { - const positiveRecommendation = new Map(contents); - positiveRecommendation.set('AGENTS.md', `${contents.get('AGENTS.md')}\nUse ${invalidForm} for a targeted repair.\n`); - assert.throws(() => validate(positiveRecommendation), /AGENTS\.md contains an unapproved branch-form reference/); + for (const {file} of documents) { + const positiveRecommendation = new Map(contents); + positiveRecommendation.set(file, `${contents.get(file)}\nUse ${invalidForm} for a targeted repair.\n`); + assert.throws( + () => validate(positiveRecommendation), + (error) => error instanceof Error + && error.message.includes(`${file} contains an unapproved branch-form reference`) + ); + } } console.log(`Fix-branch workflow documentation: ${documents.length} approved statements validated`); -if (process.argv.includes('--self-test')) console.log('Positive nested branch recommendation: rejected'); +if (process.argv.includes('--self-test')) { + console.log(`Positive nested branch recommendations: ${documents.length}/${documents.length} rejected`); +}