-
-
Notifications
You must be signed in to change notification settings - Fork 96
Fix params arrays #3146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix params arrays #3146
Conversation
…hance ParamsArgumentsTests with additional test cases for params arrays
|
Claude finished @thomhurst's task —— View job PR Review: Fix params arraysI've completed my review of this PR that fixes params arrays handling. Here's my comprehensive feedback: Todo List:
✅ Code Quality & Best PracticesTupleArgumentHelper.cs:
ParamsArgumentsTests.cs:
✅ Bug AnalysisFixed Issue: Before (buggy): var singleArgExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{paramsParam.Type.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";After (fixed): var singleElementExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{elementType.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";
argumentExpressions.Add($"new {elementType.GloballyQualified()}[] {{ {singleElementExpression} }}");No new bugs identified - the fix correctly handles the edge case while maintaining existing functionality. ✅ Performance Considerations
✅ Security Concerns
✅ Test CoverageExcellent improvement in test coverage:
Test quality highlights:
🎯 Overall AssessmentThis is a high-quality fix that:
Recommendation: Approve - This PR effectively fixes the params array issue with proper testing and follows TUnit's development standards. |
…g and improve data source attributes
|
Claude finished @thomhurst's task —— View job PR Review: Fix params arrays
|
| Scenario | Before | After |
|---|---|---|
| Empty params | ❌ | ✅ EmptyParamsArray |
| Single param (Type) | ❌ | ✅ SingleTypeInParamsArray |
| Single param (string) | ❌ | ✅ SingleStringInParamsArray |
| Multiple params (Type) | ❌ | ✅ MultipleTypesInParamsArray |
| Multiple params (string) | ❌ | ✅ MultipleStringsInParamsArray |
| Enum params | ✅ | ✅ GetOperations (existing) |
Test quality highlights:
- Assertions verify both array length and individual elements
- Different data types tested (Type, string, enum)
- Async test patterns follow TUnit conventions
- Comprehensive edge case coverage
✅ Snapshot Test Analysis
The snapshot changes across 9 test files show consistent updates to generated source code, reflecting the params array fix. All changes appear to be updating the generated code to properly handle single-element params arrays with array wrapping.
🎯 Overall Assessment
This is a high-quality fix that:
- ✅ Correctly addresses the params array type handling bug
- ✅ Maintains backward compatibility
- ✅ Follows established code patterns
- ✅ Significantly improves test coverage
- ✅ Has minimal performance impact
- ✅ Introduces no security concerns
- ✅ Updates snapshot tests appropriately
Recommendation: Approve - This PR effectively fixes the params array issue with proper testing and follows TUnit's development standards.
|
Claude finished @thomhurst's task —— View job PR Review: Fix params arraysI've completed a comprehensive review of this PR that fixes params arrays handling. Here's my detailed feedback: Todo List:
✅ Code Quality & Best PracticesTupleArgumentHelper.cs (
ParamsArgumentsTests.cs:
✅ Bug AnalysisFixed Issue: Before (buggy): var singleArgExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{paramsParam.Type.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";After (fixed): var singleElementExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{elementType.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";
argumentExpressions.Add($"new {elementType.GloballyQualified()}[] {{ {singleElementExpression} }}");No new bugs identified - the fix correctly handles the edge case while maintaining existing functionality. ✅ Performance Considerations
✅ Security Concerns
✅ Test CoverageExcellent improvement in test coverage:
Test quality highlights:
✅ Snapshot Test AnalysisThe snapshot changes across both test files show consistent updates to generated source code, reflecting the params array fix. Key observations:
✅ Adherence to TUnit GuidelinesThis PR follows all critical TUnit development rules:
🎯 Overall AssessmentThis is a high-quality fix that:
Recommendation: Approve - This PR effectively fixes the params array issue with proper testing and follows TUnit's development standards excellently. |
|
Claude finished @thomhurst's task —— View job PR Review: Fix params arraysI've completed a comprehensive review of this PR that fixes params arrays handling. Here's my detailed feedback: Todo List:
✅ Code Quality & Best PracticesTupleArgumentHelper.cs (
ParamsArgumentsTests.cs:
✅ Bug AnalysisFixed Issue: Before (buggy): var singleArgExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{paramsParam.Type.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";After (fixed): var singleElementExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{elementType.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";
argumentExpressions.Add($"new {elementType.GloballyQualified()}[] {{ {singleElementExpression} }}");No new bugs identified - the fix correctly handles the edge case while maintaining existing functionality. ✅ Performance Considerations
✅ Security Concerns
✅ Test CoverageExcellent improvement in test coverage:
Test quality highlights:
✅ Snapshot Test AnalysisThe snapshot changes across both test files show consistent updates to generated source code, reflecting the params array fix. Key observations:
✅ Adherence to TUnit GuidelinesThis PR follows all critical TUnit development rules:
🎯 Overall AssessmentThis is a high-quality fix that:
Recommendation: Approve - This PR effectively fixes the params array issue with proper testing and follows TUnit's development standards excellently. |
…ent casting logic
|
Claude finished @thomhurst's task —— View job PR Review: Fix params arraysI've completed a comprehensive review of this PR that fixes params arrays handling. Here's my detailed feedback: Todo List:
✅ Code Quality & Best PracticesTupleArgumentHelper.cs (
ReflectionTestDataCollector.cs (lines 1446-1521):
ParamsArgumentsTests.cs:
✅ Bug AnalysisFixed Issue: Before (buggy): var singleArgExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{paramsParam.Type.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";After (fixed): var singleElementExpression = $"TUnit.Core.Helpers.CastHelper.Cast<{elementType.GloballyQualified()}>({argumentsArrayName}[{regularParamCount}])";
argumentExpressions.Add($"new {elementType.GloballyQualified()}[] {{ {singleElementExpression} }}");Dual Mode Parity: The reflection mode changes ensure both source-generated and reflection modes handle params arrays identically, maintaining TUnit's critical behavioral parity requirement. No new bugs identified - the fix correctly handles the edge case while maintaining existing functionality. ✅ Performance Considerations
✅ Security Concerns
✅ Test CoverageExcellent improvement in test coverage:
Test quality highlights:
✅ Snapshot Test AnalysisThe snapshot changes across both test files show consistent updates to generated source code, reflecting the params array fix. Key observations:
✅ Adherence to TUnit GuidelinesThis PR follows all critical TUnit development rules:
🎯 Overall AssessmentThis is a high-quality fix that:
Recommendation: Approve - This PR effectively fixes the params array issue with proper testing, maintains dual-mode parity, and follows TUnit's development standards excellently. |

Fixes #2942