Conversation
Owner
ptr727
commented
Jan 30, 2026
- Added normalization methods for ExtensionTag and PrivateUseTag to ensure consistent casing and ordering of tags.
- Implemented equality checks and hash code generation for ExtensionTag and PrivateUseTag.
- Updated LanguageTagBuilder to throw an exception for empty extension tags.
- Enhanced validation in LanguageTagParser to reject whitespace in extension tags.
- Added tests to verify new behaviors and ensure robustness.
…d equality checks - Added normalization methods for ExtensionTag and PrivateUseTag to ensure consistent casing and ordering of tags. - Implemented equality checks and hash code generation for ExtensionTag and PrivateUseTag. - Updated LanguageTagBuilder to throw an exception for empty extension tags. - Enhanced validation in LanguageTagParser to reject whitespace in extension tags. - Added tests to verify new behaviors and ensure robustness.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the language tag functionality by adding proper equality semantics, normalization capabilities, and improved validation for extension and private use tags. The changes also include a bug fix for exception handling in the HTTP client resilience policies and removal of unused code.
Changes:
- Added case-insensitive equality comparison and hash code generation for
ExtensionTagandPrivateUseTagrecords - Enhanced validation to reject whitespace in extension tags and empty extension collections
- Fixed HTTP client resilience handler to properly handle exceptions in addition to unsuccessful status codes
- Removed unused helper methods from Program.cs
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| LanguageTags/LanguageTag.cs | Implemented Equals() and GetHashCode() methods for ExtensionTag and PrivateUseTag to support case-insensitive, element-wise comparison |
| LanguageTags/LanguageTagParser.cs | Enhanced ValidateExtension() to check for whitespace characters and added empty extension validation |
| LanguageTags/LanguageTagBuilder.cs | Added validation to throw ArgumentException when attempting to add empty extension tag collections |
| LanguageTagsTests/LanguageTagTests.cs | Updated tests to verify case-insensitive equality and removed unused System.Linq import |
| LanguageTagsTests/LanguageTagParserTests.cs | Added test case for extension tag with whitespace validation |
| LanguageTagsTests/LanguageTagBuilderTests.cs | Added tests for empty extension validation and whitespace rejection |
| LanguageTagsCreate/HttpClientFactory.cs | Fixed resilience handler to check for exceptions in addition to unsuccessful HTTP status codes |
| LanguageTagsCreate/Program.cs | Removed unused GetCommandLineOptions() and GetCancellationToken() methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.