apple / pkl-pantry

Shared Pkl packages
Apache License 2.0
229 stars 31 forks source link

[pkl.experimental.net] Disallow unicode digits in IPs, ports #46

Closed lilyball closed 3 months ago

lilyball commented 3 months ago

This PR introduces a test suite for IP address strings, complete with failing tests for IP address strings containing unicode digits, and then fixes the failing tests by changing the regexes to stop allowing unicode digits.

As part of this work I also converted the IPv6 regex into expanded form with whitespaces and comments in order to make it more readable so I could verify the test suite covered everything. The new regex is identical to the old one so no behavior changed there. That commit could be removed without changing the rest of this PR but it seems nice to have.