• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cweill / gotests / 18673216511 / 1
94%
master: 94%

Build:
DEFAULT BRANCH: master
Ran 21 Oct 2025 04:49AM UTC
Files 11
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Oct 2025 04:47AM UTC coverage: 72.073% (-11.9%) from 83.958%
18673216511.1

push

github

cweill
Add full Go generics support (v1.8.0)

This release adds complete support for Go generics (type parameters),
enabling gotests to generate tests for generic functions and methods
on generic types.

Features:
- Generate tests for generic functions with type parameters
- Support for all constraint types: any, comparable, union types, approximation constraints
- Generate tests for methods on generic types (e.g., Set[T], Map[K,V])
- Support for multiple type parameters
- Smart type parameter substitution throughout generated tests
- Intelligent constraint-to-concrete-type mapping

Parser Enhancements:
- New parseTypeDecls() extracts type parameters from type declarations
- New parseTypeParams() parses AST field lists for type parameters
- New extractBaseTypeName() strips type parameters from receiver types
- Resolves type parameters for methods on generic types

Model Updates:
- New TypeParam struct with Name and Constraint fields
- Added TypeParams field to Function struct
- New helper methods: IsGeneric(), HasGenericReceiver(), TypeParamMapping()
- Test names automatically strip type parameters

Template & Render Improvements:
- New TypeArgs template function for generic function calls
- New FieldType function for type parameter substitution in fields
- New ReceiverType function for type parameter substitution in receivers
- Smart constraint-to-type mapping with support for numeric constraints

Type Constraint Mapping:
- any → int (simple value type)
- comparable → string (commonly comparable type)
- Union types → first option (e.g., int64 | float64 → int64)
- Approximation constraints → underlying type (e.g., ~int → int)

Test Coverage:
- 97.5% main package coverage (all tests passing)
- 83.5% overall project coverage
- 100% coverage on all new parser functions
- 8 comprehensive generic test patterns

Fixes #165

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

831 of 1153 relevant lines covered (72.07%)

917.42 hits per line

Source Files on job 18673216511.1
  • Tree
  • List 11
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 18673216511
  • 88ad3dfe on github
  • Prev Job for on master (#18671742228.1)
  • Next Job for on master (#18674065592.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc