Daily Test Coverage Improver: Add comprehensive HttpEncodings tests #1586
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
This PR adds comprehensive test coverage for the
FSharp.Data.HttpEncodingsmodule, which was previously at 66.6% coverage. The implementation provides extensive testing for encoding name resolution and codepage functionality.Coverage Impact
Test Coverage Details
Core Encoding Functionality
✅ Default encodings validation - PostDefaultEncoding and ResponseDefaultEncoding
✅ Encoding name resolution - Valid encoding names (UTF-8, ASCII, ISO-8859-1)
✅ Codepage resolution - Valid codepage numbers (65001→UTF-8, 1200→UTF-16)
✅ Error handling - Invalid encoding names and codepage numbers
Technical Implementation
HttpEncodings.fstest file to complement existing HTTP testsTest Results
All tests pass consistently and provide comprehensive coverage of the HttpEncodings module functionality.
Quality Assurance
✅ All new tests pass - 9/9 successful test cases
✅ No regressions - All 2,689 existing tests continue to pass
✅ Code formatting - Applied project formatting standards
✅ Build verification - Clean compilation with no warnings
This work addresses the HttpEncodings module identified in coverage analysis as having lower coverage, ensuring reliability for encoding operations used throughout the FSharp.Data HTTP functionality.
Commands Executed
Bash commands:
git checkout -b daily-test-improver-http-coveragedotnet build tests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsprojdotnet test tests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsproj --filter "FullyQualifiedName~HttpEncodings"dotnet test tests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsproj --verbosity minimaldotnet run --project build/build.fsproj -- -t Formatgit add ...andgit commit ...andgit push ...Web Searches: None performed
Web Pages Fetched: None