Skip to content

test: consolidate regex/patterns/findMatches tests into index.test.ts - #9

Merged
otnc merged 1 commit into
mainfrom
test/consolidate-into-index-test
Aug 23, 2026
Merged

test: consolidate regex/patterns/findMatches tests into index.test.ts#9
otnc merged 1 commit into
mainfrom
test/consolidate-into-index-test

Conversation

@otnc

@otnc otnc commented Aug 23, 2026

Copy link
Copy Markdown
Owner

The three test files had grown overlapping/redundant coverage: most of regex.test.ts's individual case list (single-pattern checks like "うおw") duplicated what the per-pattern loop in patterns.test.ts already verifies more precisely (tied to the pattern's own id). Consolidated into one test/index.test.ts:

  • findAll/contains: kept only the scenarios not covered elsewhere (basic smoke check, the (笑)-with-stem regression, multi-pattern findAll matching, and argument validation - the last of these wasn't tested anywhere before)
  • findMatches: unchanged, moved as-is
  • パターン別サンプル: the auto-generated per-pattern loop, now also asserting findMatches returns the same pattern id for each sample (so both the combined-regex path and the per-pattern-regex path are exercised)

Net effect: 3 files / ~120 tests with real duplication -> 1 file / 140 tests with each one covering something the others don't.

The three test files had grown overlapping/redundant coverage: most of
regex.test.ts's individual case list (single-pattern checks like "うおw")
duplicated what the per-pattern loop in patterns.test.ts already verifies
more precisely (tied to the pattern's own id). Consolidated into one
test/index.test.ts:

- findAll/contains: kept only the scenarios not covered elsewhere (basic
  smoke check, the (笑)-with-stem regression, multi-pattern findAll
  matching, and argument validation - the last of these wasn't tested
  anywhere before)
- findMatches: unchanged, moved as-is
- パターン別サンプル: the auto-generated per-pattern loop, now also
  asserting findMatches returns the same pattern id for each sample (so
  both the combined-regex path and the per-pattern-regex path are
  exercised)

Net effect: 3 files / ~120 tests with real duplication -> 1 file / 140
tests with each one covering something the others don't.
@otnc
otnc merged commit 1c087a7 into main Aug 23, 2026
3 checks passed
@otnc
otnc deleted the test/consolidate-into-index-test branch August 23, 2026 14:03
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