Skip to content

Test gaps: unpinned branches, assertions that cannot fail, and no consumer-shaped install #10

Description

@mairas

From the review on PR #1: #1 (comment)

Gaps the reviewers found by running the code and reading branch coverage. Several are behaviours that are correct today with nothing holding them there.

Untested branches, all confirmed correct by probe: check_typography's "opens while already open" quotation fault (one of three fault branches, so a third of the alternation walk ships unproven); map_anchors' same-page #fragment links and second-run idempotency; stamp_translation's unterminated-frontmatter SystemExit and translation_status.stamp_of returning None on the same input; check_glossary's accent and apostrophe folding, its non-word-initial rows, and its multi-word intervening-word join — the three heuristics with the longest docstrings and no tests; check_anchors' site_url without a trailing slash and mkdocs.yml without site_url.

Plan scenarios with no test: an .html-suffixed link in check-anchors (branch 90→92 is dead in the suite, and use_directory_urls: false emits that form for every link); the oversized-comment case driven by entry count rather than diff size (see #1).

Assertions that cannot fail: test_the_failure_names_every_page_and_locale_responsible asserts 'missing' in out and 'stale' in out against combined stdout, and the report printed above the gate block already contains both words — render_failure could drop the state column entirely and it would pass. Six gate tests assert != 0 where the exit status is a contract with CI and check-anchors already distinguishes 1 from 2. One glossary test accepts capsys and never reads it.

Nothing installs the package the way consumers will. test_entry_points reads installed metadata and calls main() in-process, so a packaging fault that broke the console-script shim while leaving the module importable would pass. CI runs uv sync on the repo itself, never halos-docs-tools @ git+https://...@vX.Y.Z in a foreign project — the pin line the README documents, and the whole of R3 and R4.

No test builds a real mkdocs site and asserts that collect()'s source set equals the pages mkdocs publishes. That single test would have caught the P1 fixed in PR #1 in all three of its forms; conftest.py constructs the tree by hand and therefore only exercises the layout the checker already assumes.

Also missing: a shallow-clone case, a non-UTF-8 page, a CRLF page, and a .gitattributes test asserting the stamp does not move (the last landed in PR #1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions