Daily Test Coverage Improver - SpanPrimitives Tests (Inline Function Limitation) #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Added 30 comprehensive tests for the
SpanINumberPrimitivesmodule, covering all major primitive operations used throughout the FsMath library.Tests Added
Test Coverage by Function Group
mapInto Functions (6 tests)
map2Into Functions (6 tests)
mapScalarInto Functions (6 tests)
fold Functions (6 tests)
fold2 Functions (6 tests)
Test Strategy
All tests use non-inline wrapper functions in the test module that delegate to the inline
SpanINumberPrimitivesfunctions. This approach was chosen to:Test Coverage Results
Why No Coverage Improvement?
F# inline functions are resolved at compile time and don't exist in the IL as callable methods. Coverage tools instrument IL code, so they cannot track execution of inline functions. Both attempts to work around this failed:
Despite 0% reported coverage, all 30 tests pass and thoroughly validate:
The Challenge with Inline Functions and Coverage
From the previous discussion:
While this technique works for some inline functions, it fails for Span-based code because:
Span<T>andReadOnlySpan<T>are byref typesAlternatives Considered
Value of This PR
Even without coverage metric improvements, this PR provides:
Replicating the Test Coverage Measurements
Commands
Expected Results
Future Improvement Opportunities
Based on the coverage analysis, these modules have good potential for meaningful coverage improvements:
VectorModule.fs - 23.33% coverage, 180 lines
Matrix.fs - 42.77% coverage, 720 lines
MatrixModule.fs - 80.00% coverage, 130 lines
Recommendation
While this PR doesn't improve coverage metrics, I recommend:
The inline function coverage issue is a tooling limitation, not a code quality issue. These tests are valuable and should be preserved.
Bash Commands Executed
Web Searches Performed
None - worked from existing codebase and documentation.
Web Pages Fetched
None - all work based on repository analysis.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com