Skip to content

test(mapping): add dedicated tests for compose_mappings#12

Merged
protosphinx merged 1 commit into
mainfrom
bot/compose-mapping-tests
May 22, 2026
Merged

test(mapping): add dedicated tests for compose_mappings#12
protosphinx merged 1 commit into
mainfrom
bot/compose-mapping-tests

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

compose_mappings is the public API for stacking event-to-symbol strategies (regex, embedding, LLM, manual). It is mentioned explicitly in the roadmap and README as the composition primitive, but its behavior is only tested indirectly in two tests at the tail of test_mapping_manual.py. This PR adds a dedicated test file covering the paths those tests miss.

What

  • New file tests/test_mapping_compose.py with 9 focused tests:
    • zero-strategy composition returns all-empty results
    • single-strategy passthrough matches a direct call
    • all strategies miss for an event, returns empty list
    • three-strategy chain: second fills the gap, third result is not used
    • multiple events resolved by different strategies, with a no-match case
    • duplicate events deduplicated in the composed result
    • empty events input returns empty dict
    • empty symbol list: all strategies miss
    • result key order matches input event order

Tests

  • tests/test_mapping_compose.py: 9 new tests, all green
  • Full suite: 97 passed (was 88), 0 failures

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (added + removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

Cover gaps not exercised by the per-strategy test files: zero-strategy
composition, single-strategy passthrough, all-miss path, three-strategy
chain where the second fills and the third is not used, multiple events
resolved by different strategies, duplicate-event deduplication, empty
events, empty symbols, and result-key ordering.
@protosphinx protosphinx merged commit 3cb5336 into main May 22, 2026
6 checks passed
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