Skip to content

[chore] Add internal/resolver edge-case tests (SplitServiceInput, ServiceFromBranch) #176

@lugassawan

Description

@lugassawan

Type

  • Tests (coverage gaps, e2e, fixtures)

Files to change

  • internal/resolver/resolver_test.go

Description

TestSplitServiceInput and TestServiceFromBranch in internal/resolver/resolver_test.go cover the happy path and a few prefixed cases, but several edge cases are not exercised:

G2 — SplitServiceInput edge cases

  • Empty string input "" — should return ("", "") without panicking
  • Input with only a separator character (e.g., "/") — candidate and variant parts are both empty
  • Input with multiple separator characters (e.g., "auth/v2/beta") — only the first separator should split; the rest belong to the variant
  • Leading/trailing whitespace in input

G3 — ServiceFromBranch edge cases

  • Branch name with no matching prefix — should return ("", "", "") cleanly
  • Branch name where the prefix matches but the task part is empty (e.g., "feat/")
  • Multiple prefixes where the longer one matches vs. the shorter one (prefix-ordering sensitivity)
  • Branch name that is exactly equal to a prefix with no trailing task name

These gaps are low-risk but improve confidence when the resolver is extended.

Acceptance

  • New table rows or sub-tables added to TestSplitServiceInput covering the G2 cases listed above.
  • New table rows added to TestServiceFromBranch covering the G3 cases listed above.
  • All tests pass (make test).
  • Coverage does not drop below the 97% threshold.

Bundles

Original candidates folded into this issue:

  • G2 (internal/resolver/resolver_test.go:189): SplitServiceInput missing edge-case table rows.
  • G3 (internal/resolver/resolver_test.go:226): ServiceFromBranch missing edge-case table rows (empty-prefix match, prefix-ordering, empty task segment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions