Skip to content

[test-gap] code list: no spec verifies all receiver methods on a multi-method struct are extracted #19

Description

@Anand-rahul

Problem

The only Go fixture with receiver methods is go-module-with-checkout-validator, which defines a single method (CheckoutValidator.Validate). A tree-sitter extraction bug that silently drops every Nth method, or stops after the first method on a struct, passes the entire code/* test suite.

What Is Missing

T3.1 — Multi-method receiver extraction count

tests/e2e/specs/code/multi-receiver-method-extraction-count.yaml

A fixture (go-module-multi-receiver) defines requestValidator with 8 private receiver methods (run, checkName, checkType, checkDuplicates, checkSystem, checkIndexes, applyRules, checkUnique) plus two functions in a separate package (server.DeleteRecord, server.handleRequest).

The spec asserts:

  • All 8 method qualified names are present individually by exact name
  • Both cross-package entities are present (verifies extraction is not limited to the first parsed package)
  • Hallucinated method names (String, Error, Validate) are absent
  • A shell count via grep -o "requestValidator\." produces exactly 8 (catches off-by-one bugs)

Key Insight

Private (lowercase) receiver methods are indexed by tree-sitter regardless of case. But the change-process pipeline (goMethodRE) only extracts uppercase-first names from diffs. The multi-method extraction test exercises the tree-sitter path; the api-break test covers the pipeline path. These are separate code paths that need separate coverage.

Status

Spec implemented and passing on impl/phase2. The go-module-multi-receiver fixture is codebase-agnostic (generic requestValidator/DeleteRecord names).

References

  • internal/change_process/pipeline.go lines 1062–1063 — goFuncRE, goMethodRE (uppercase-first requirement)
  • tests/e2e/helpers/repos.goGoModuleMultiReceiverServer helper
  • tests/e2e/specs/code/multi-receiver-method-extraction-count.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions