FLUTTER ECOSYSTEM

source_gen_test

Test support for the source_gen package. Includes helpers to make it easy to validate both success and failure cases.

Latest version
1.3.7
30-day downloads
44.1K
Likes
13
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

A testing utility package for source_gen that provides helpers to easily validate both successful and failed code generation scenarios. It simplifies writing tests by offering tools to assert expected outputs and handle error conditions during code generation, ensuring reliability and correctness in build-time code generation workflows. Designed to integrate seamlessly with the source_gen ecosystem, it supports testing custom generators across different platforms.

Use cases
  • Testing code generation success cases
  • Validating error handling in generators
  • Ensuring consistent output from custom builders
  • Integrating with CI/CD pipelines
  • Verifying generator behavior across platforms
  • Debugging source generation logic
Key features
  • Helpers for success and failure assertions
  • Built-in support for test-driven generator development
  • Cross-platform compatibility
  • Easy integration with source_gen
  • Robust validation of generated code
  • Supports complex test scenarios
Suitable for
  • Developers building custom source generators
  • Teams using source_gen for boilerplate automation
  • Testers validating code generation outputs
  • Projects requiring reliable build-time code generation
  • Flutter/Dart projects with extensive code generation needs
Considerations
  • Requires familiarity with source_gen framework
  • Best used in conjunction with build_runner
  • May need additional setup for complex test environments
  • Not intended for runtime testing
  • Limited to build-time code generation testing
Supported platformsmacOSWindowsLinux

Install package

flutter pub add source_gen_test

Categories

Dependencies

Dependency list 8 items

Source repository

Related projects