Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rfc1918ClassBPrivateSpec incorrect matches #796

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ object net {
IPv4 And StartsWith[W.`"10."`.T]

type Rfc1918ClassBPrivateSpec =
IPv4 And MatchesRegex[W.`"^172\\\\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).+"`.T]
IPv4 And MatchesRegex[
W.`"^172\\\\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\\\\..+"`.T
]

type Rfc1918ClassCPrivateSpec =
IPv4 And StartsWith[W.`"192.168."`.T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NetTypesSpec extends Properties("NetTypes") {

property("Rfc1918ClassBPrivateSpec.before") = secure {
showResult[Rfc1918ClassBPrivateSpec]("172.14.255.255") ?=
"""Right predicate of (172.14.255.255 is a valid IPv4 && "172.14.255.255".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).+")) failed: Predicate failed: "172.14.255.255".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).+")."""
"""Right predicate of (172.14.255.255 is a valid IPv4 && "172.14.255.255".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\..+")) failed: Predicate failed: "172.14.255.255".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\..+")."""
}

property("Rfc1918ClassBPrivateSpec.isValid.first") = secure {
Expand All @@ -48,7 +48,12 @@ class NetTypesSpec extends Properties("NetTypes") {

property("Rfc1918ClassBPrivateSpec.after") = secure {
showResult[Rfc1918ClassBPrivateSpec]("172.32.0.0") ?=
"""Right predicate of (172.32.0.0 is a valid IPv4 && "172.32.0.0".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).+")) failed: Predicate failed: "172.32.0.0".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).+")."""
"""Right predicate of (172.32.0.0 is a valid IPv4 && "172.32.0.0".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\..+")) failed: Predicate failed: "172.32.0.0".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\..+")."""
}

property("Rfc1918ClassBPrivateSpec.issue795") = secure {
showResult[Rfc1918ClassBPrivateSpec]("172.222.255.255") ?=
"""Right predicate of (172.222.255.255 is a valid IPv4 && "172.222.255.255".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\..+")) failed: Predicate failed: "172.222.255.255".matches("^172\.(15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\..+")."""
}

property("Rfc1918ClassCPrivateSpec.before") = secure {
Expand Down