From b2048f63bd9957330d8f1109a72cb99a34998c90 Mon Sep 17 00:00:00 2001 From: codex-bot-andresmgsl Date: Mon, 24 Aug 2026 16:02:01 +0000 Subject: [PATCH] test: pin Refs token boundaries (#234) --- test/issueflow-reconcile.test.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/issueflow-reconcile.test.sh b/test/issueflow-reconcile.test.sh index 0d0d8ed..83131d9 100644 --- a/test/issueflow-reconcile.test.sh +++ b/test/issueflow-reconcile.test.sh @@ -101,6 +101,25 @@ check "empty labels do not exempt a claimed issue" 0 "SWEEP" claim_clock_exempt refs_body=$'Refs #12\nAlso refs: #8 and heavy-duty/rig#4.\nCloses #99\nNot refs-ish #7\nfix refs parsing from #200\nCloses #40; refs: none\nRefs #175 (split from #150)' check "Refs parser returns only references owned by a valid Refs marker" 0 "" \ test "$(refs_references <<<"$refs_body")" = $'8\n12\n175' +# A Refs declaration binds one token, never the prose that follows it; every +# later occurrence starts a fresh declaration (#234). +crew_round_line='- **Claude verified the safe `Refs #52`, TDD provenance, and inherited #65 CI failure.**' +check "Refs parser ignores issue prose after the bound token" 0 "" \ + test "$(refs_references <<<"$crew_round_line")" = 52 +check "Refs comma-list narrowing is deliberate" 0 "" \ + test "$(refs_references <<<'Refs #8, #9')" = 8 +check "a cross-repo Refs token stays non-local" 0 "" \ + test -z "$(refs_references <<<'Refs heavy-duty/rig#4')" +check "prose after a cross-repo Refs token stays non-local" 0 "" \ + test -z "$(refs_references <<<'Refs heavy-duty/rig#4, #12')" +check "parenthesized prose after a local Refs token is ignored" 0 "" \ + test "$(refs_references <<<'Refs #175 (split from #150)')" = 175 +check "every Refs occurrence on one line contributes its bound token" 0 "" \ + test "$(refs_references <<<'Refs #8. Refs #9.')" = $'8\n9' +check "lowercase refs in unrelated prose declares nothing" 0 "" \ + test -z "$(refs_references <<<'fix refs parsing from #200')" +check "Refs without a following token declares nothing" 0 "" \ + test -z "$(refs_references <<<'Closes #40; refs: none')" open_records=$'BODY\tRefs #5\nCLOSING\t9\nBODY\tRefs heavy-duty/rig#112\nBODY\tRefs #5\nCLOSING\t5' check "open PR linkage unions closing and local Refs body references" 0 $'5\n9' \ open_pr_issues <<<"$open_records"