Skip to content

Conversation

@bendrucker
Copy link
Member

@bendrucker bendrucker commented Nov 21, 2025

Follow-up to #991 adding test coverage and improvements to the HCL transform system.

  • Adds tests for transform functions, error cases, and function composition
  • Improves multi-variable error messages to show actual variable names: references 2 variables ([Foo, Bar]), expected exactly 1
  • Fixes eval context pollution by using fresh variable maps per iteration
  • Handles empty list edge case in cty conversions
  • Pre-allocates slices for performance
  • Documents transform system with usage examples

Adds comprehensive test coverage for the HCL transform system introduced in #991:
- Unit tests for stringsToCtyList helper
- Tests for makeListTransformFunction with uppercase and replace
- Error case testing for invalid inputs
- Transform composition tests

Improves error handling and code quality:
- Enhanced error messages showing variable names when multiple variables referenced
- Clean eval context handling using fresh variable maps instead of deletion
- Pre-allocated slices for better performance
- Proper empty list handling in cty conversions
- Comprehensive documentation of transform system

All tests pass and generator continues to work correctly.
@bendrucker bendrucker merged commit 8f22300 into master Nov 21, 2025
12 checks passed
@bendrucker bendrucker deleted the add-generator-tests-and-improvements branch November 21, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants