Skip to content

Delete TestMatchesGlobs and TestMatchesAction private function tests#83

Merged
gregology merged 1 commit intomainfrom
remove-private-function-tests
Mar 17, 2026
Merged

Delete TestMatchesGlobs and TestMatchesAction private function tests#83
gregology merged 1 commit intomainfrom
remove-private-function-tests

Conversation

@gregology
Copy link
Copy Markdown
Contributor

@gregology gregology bot commented Mar 16, 2026

Fixes #76

Our docs/testing.md literally calls out matchesGlobs by name as the canonical example of what not to test: "if matchesGlobs breaks, a Resolve test will catch it. Testing both just means two tests to update when the signature changes." And yet there it was, sitting in the test suite alongside TestMatchesAction, doing exactly the thing the docs tell contributors not to do.

This matters because new contributors read the tests before they read the docs. Having private function tests in the codebase signals "this is how we do things here" regardless of what the guidelines say. It undermines the whole testing philosophy we spent time documenting.

Every scenario these two tests covered is already exercised through the public Resolve() API:

  • Glob matching (double-star, extensions, directory-scoped, single-star) -> TestResolve_NonPythonFile, TestResolve_ExcludePattern, TestResolve_EditBefore
  • Exclude overrides -> TestResolve_ExcludePattern + the ExcludeOverridesMatch property test
  • Directory boundaries -> TestResolve_ContextAboveRootIsIgnored
  • Action filtering -> TestResolve_ReadDoesNotMatchEditOnly, TestResolve_CreateAction, and the EditEntriesFilteredForActionRead property test

No coverage gaps. Just removed the duplication.

Why not keep them as "extra safety"? Because that's exactly the trap the docs warn about. Two tests covering the same behavior means two things to update when internals change, which makes refactoring harder and trains people to see private function tests as normal. The 19 remaining TestResolve_* tests (including 5 property-based ones with randomized inputs) give us better coverage than the deleted unit tests ever did.

Dev Ghost metrics

Total duration: 4m 32s
Turns: 60
Tool calls: 48
Tokens: 368,976 input / 5,084 output

Stage Model Duration Turns Tool calls Tokens (in/out) Cache read Cache creation
triage claude-opus-4-6 1m 18s 27 25 40,107 / 1,097 34,776 5,327
implementation claude-opus-4-6 2m 3s 14 9 135,650 / 2,482 114,256 21,382
evaluation claude-opus-4-6 0m 20s 4 2 39,844 / 428 35,559 4,281
docs_review claude-opus-4-6 0m 30s 14 11 92,512 / 527 69,616 22,890
craft_pr claude-opus-4-6 0m 19s 1 1 60,863 / 550 35,641 25,219

Resolves #76

@gregology gregology merged commit 8477c92 into main Mar 17, 2026
2 checks passed
@gregology gregology deleted the remove-private-function-tests branch March 17, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Private function tests directly contradict the stated testing philosophy

1 participant