Repository navigation
test(check-links): pin has_id's metacharacter escaping and <a ... name=> after other attributes - #297
Conversation
…nd <a ... name=> after other attributes Three arms of the #295 has_id regex pass the self-test when broken: escaping only '.', dropping the optional attribute group before name=, and leaving the name= arm unescaped. Each now fails a fixture case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Looks correct to me. I checked the new fixture against has_id at scripts/check-links.sh:44-46 on the PR head and reproduced the mutation numbers from the body:
- head:
check-links self-test: 125 passed, 0 failed - escaping only
.in theesc=sed (scripts/check-links.sh:44): 122 passed, 3 failed — the#a+b/#q(1)false passes and theexpect_no_outonc+d|r(2)|with-attrsall trip - dropping
([^>]*[[:space:]])?from thename=arm (scripts/check-links.sh:46): 123 passed, 2 failed —<a class="x" href="#top" name="with-attrs">is reported missing and theInternal errors: 3.count moves
The case follows the existing new_site / run_checker / expect_* pattern at scripts/check-links.test.sh:52-75, and Internal errors: 3. pins the count so an extra false pass cannot hide behind the regex alternation. Test-only change, no checker edit. Nothing further from me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Looks correct to me — test-only, and the new case does pin what it says it pins.
Verified against scripts/check-links.sh:39-47 at head 95100fe:
check-links.test.shat HEAD: 125 passed, 0 failed.- Mutant replacing the
sedescape atcheck-links.sh:44with dot-only escaping: the new case fails on#a+b,#q(1)and theexpect_no_outarm → 122/125, matching the PR body. - Mutant dropping
([^>]*[[:space:]])?from thename=arm atcheck-links.sh:46:#with-attrsis reported missing and theInternal errors: 3.count breaks → 123/125.
The fixture's <a class="x" href="#top" name="with-attrs"> at the new test line 138 is the only coverage for a named anchor with preceding attributes, which is the arm most likely to regress on a future "simplify the regex" change, so this is worth having. Refs #296 is appropriate here — the mutation-harness gate is explicitly left to maintainers.
Reviewer: hive reviewer-2 (claude-fable-5.1).
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Test Improvement
#295 rewrote
has_idto escape ERE metacharacters and to scopename=to<a>tags, and added a self-test case for it. Three arms of the new regex are not distinguished by that case — each of these mutants keepscheck-links.test.shat 119/119:.instead of every metacharacter →#a+bis satisfied byid="aab",#q(1)byid="q1"(false pass on the live checker);([^>]*[[:space:]])?group →<a class="x" href="#top" name="with-attrs">is reported missing (a legitimate named anchor would fail CI);name=arm →#n.mis satisfied by<a name="nzm">.This adds one fixture case that pins all three (125/125 at HEAD; 122, 123 and 123 under the mutants respectively). No checker change.
Refs #296 (gate proposal for a shell mutation harness stays open for the maintainers' decision; this PR only pins the three arms that motivated it).
Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88