Skip to content

Expand match_taxa branch coverage and fix aff. fuzzy reason text#283

Open
dfalster wants to merge 1 commit into
masterfrom
tests/expand-match-branch-coverage
Open

Expand match_taxa branch coverage and fix aff. fuzzy reason text#283
dfalster wants to merge 1 commit into
masterfrom
tests/expand-match-branch-coverage

Conversation

@dfalster

Copy link
Copy Markdown
Member

Pins match_taxa() behaviour before refactoring the matcher.

Changes

  • Fix malformed aligned_reason for fuzzy genus-level aff./affinis matches (match_06b/06c/06d), which appended the date without a separating ( — output was ...genus-rank2026-..).
  • Extend test_matches_alignments_updates.csv with inputs for the 7 match branches no benchmark previously reached (03e, 04e, 06e, 08e, 12g, 12h, 12i); now covers all 54 branches. Refreshed the previously-unused alignment_code column to real values.
  • Assert alignment_code in the alignment regression test (was selected but never checked — which is why the reason bug hid).
  • Add test-match_branches.R: dark-branch resolution, aligned_reason well-formedness, and a full-output snapshot (_snaps/match_branches.md, date-normalised) covering all branches.

Why

These tests are the safety net for the planned match_taxa() de-duplication refactor (#279): a behaviour-preserving change leaves the snapshot + assertions green.

Verification

Full suite: 162 passed, 0 failed (resources version 2024-10-11).

Related: #279, #281

🤖 Generated with Claude Code

Before refactoring the 54-branch match_taxa(), pin its behaviour:

- Fix malformed aligned_reason for fuzzy genus-level aff./affinis matches
  (match_06b/06c/06d), which appended the date without a separating " (".
- Extend test_matches_alignments_updates.csv with inputs for the 7 match
  branches no benchmark previously reached (03e/04e/06e/08e/12g/12h/12i)
  and refresh the (previously unused) alignment_code column.
- Assert alignment_code in the alignment regression test.
- Add test-match_branches.R: dark-branch resolution, aligned_reason
  well-formedness, and a full-output snapshot covering all match branches.

Full suite: 162 passed, 0 failed (resources version 2024-10-11).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant