Addressing issues, cleaning up, adding tests dropping gulliver & refactoring like a boss#72
Closed
rheone wants to merge 20 commits into
Closed
Conversation
## Breaking Changes ### SubnetUtilities static fields are now readonly `SubnetUtilities.PrivateIPAddressRangesList` and `LinkLocalIPAddressRangesList` are now declared `readonly`. Any code that reassigned these field references (e.g. `SubnetUtilities.PrivateIPAddressRangesList = myList`) will no longer compile. The `IReadOnlyList<Subnet>` type already prevented content mutation; `readonly` now also prevents reference replacement. ## Bug Fixes ### AbstractIPAddressRange.Overlaps — symmetry restored `Overlaps(IIPAddressRange)` previously returned `false` when the argument range was wholly contained inside `this`. Added `addressRange.Contains(this)` to the check so the method is symmetric: `A.Overlaps(B) == B.Overlaps(A)` in all cases. Bidirectional and Subnet-typed symmetry regression tests added. ### AbstractIPAddressRange — ContainsAnyPrivateAddresses / ContainsAllPublicAddresses All four `ContainsAny/AllPrivate/PublicAddresses` methods previously used an endpoint heuristic that produced wrong results when both endpoints of a range were public but the interior spanned a private subnet (e.g. 11.0.0.0-173.0.0.0 spans 172.16.0.0/12). All four methods now independently use range-overlap detection against `PrivateIPAddressRangesList`. Regression tests for the spanning-block case and cross-method inverse-assertion tests added. ### IPAddressRange.TryExcludeAll — boundary guards at family min/max All four unguarded `Increment`/`Increment(-1)` call sites are now guarded with `IsAtMax`/`IsAtMin`. When an exclusion ends at the family maximum (e.g. 255.255.255.255) the method returns `(true, leading segment)` or `(true, [])` instead of throwing `InvalidOperationException`. When an exclusion starts at the family minimum the trailing-segment path is guarded symmetrically. Boundary behavior is documented in XML remarks. Regression tests for IPv4 and IPv6 family-max/min exclusion cases added. ### MacAddress.IsUnusable — implementation corrected `IsUnusable` previously used `Any(b != 0)` and returned `true` for almost every real MAC address — the logical inverse of the documented contract. Fixed to `All(b == 0)`: returns `true` only when all three OUI bytes are 0x00. All four existing test cases have their expected values corrected with comments noting the intentional behavioral fix. ## Additional Coverage - `Overlaps(Subnet)` typed override: explicit bidirectional symmetry test - `Overlaps(IIPAddressRange)` called from a Subnet context: symmetry test - `TryExcludeAll`: IPv4 and IPv6 family-max and family-min boundary tests - Private/public spanning-block regression + ContainsAnyPrivate <-> ContainsAllPublic inverse assertions
Addressing targeting issues with specific lang version change Adds RFC notes Cleans up ToBase85String Dropped (most) obsolete items; including MAC Address type Cleaned up ToDottedQuadString method Using modern collection conventions
fixing bad exceptions - adding tests too using matching and switch where possible Touches serialization Addresses warnings
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.
No description provided.